aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Niedermayer2019-08-22 19:29:19 +0200
committerMichael Niedermayer2019-08-23 14:38:42 +0200
commitac77c5492f5fcee10789c6ed205af0f718b12e82 (patch)
tree5f70ad6356a9a58cadf500718350a8da1cefce10 /tools
parentb29c7bcbf6bc257f4302b8bed0509bb5489ca068 (diff)
tools/target_dec_fuzzer: Do not increase max_pixels
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tools')
-rw-r--r--tools/target_dec_fuzzer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index d83039417c..5119a7c5da 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -180,12 +180,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
- AVCodecContext* ctx = avcodec_alloc_context3(NULL);
+ AVCodecContext* ctx = avcodec_alloc_context3(c);
AVCodecContext* parser_avctx = avcodec_alloc_context3(NULL);
if (!ctx || !parser_avctx)
error("Failed memory allocation");
- ctx->max_pixels = maxpixels_per_frame; //To reduce false positive OOM and hangs
+ if (ctx->max_pixels == 0 || ctx->max_pixels > maxpixels_per_frame)
+ ctx->max_pixels = maxpixels_per_frame; //To reduce false positive OOM and hangs
if (size > 1024) {
GetByteContext gbc;