summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-06 17:43:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-07-06 21:44:31 +0200
commit29c95765e8297cba75811c78d8ffffc2824479ca (patch)
treebcf0a6032bf7be8a4078355e8ee5e39fc2901184 /tools
parent343d950a4a8a8c32f5f7d9d4ac1fbe317cb9cc80 (diff)
tools/target_dec_fuzzer: move maximum variables into function
This fixes an issue when multiple cases are fuzzed in a single run and the limits are adjusted by more than the iteration limit. In that case the adjusted limit leaked back into the global limit causing the fuzzer to become ineffective after several iterations, MSS2 was affected by this for example. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tools')
-rw-r--r--tools/target_dec_fuzzer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 6092f6775d..96b8f81958 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -98,15 +98,15 @@ static int audio_video_handler(AVCodecContext *avctx, AVFrame *frame,
// Ensure we don't loop forever
const uint32_t maxiteration = 8096;
-uint64_t maxpixels_per_frame = 4096 * 4096;
-uint64_t maxpixels;
-
-uint64_t maxsamples_per_frame = 256*1024*32;
-uint64_t maxsamples;
static const uint64_t FUZZ_TAG = 0x4741542D5A5A5546ULL;
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ uint64_t maxpixels_per_frame = 4096 * 4096;
+ uint64_t maxpixels;
+
+ uint64_t maxsamples_per_frame = 256*1024*32;
+ uint64_t maxsamples;
const uint64_t fuzz_tag = FUZZ_TAG;
const uint8_t *last = data;
const uint8_t *end = data + size;