[FFmpeg-cvslog] tools/target_dec_fuzzer: move maximum variables into function

Michael Niedermayer git at videolan.org
Tue Jul 6 22:45:49 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Jul  6 17:43:08 2021 +0200| [29c95765e8297cba75811c78d8ffffc2824479ca] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29c95765e8297cba75811c78d8ffffc2824479ca
---

 tools/target_dec_fuzzer.c | 10 +++++-----
 1 file 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;



More information about the ffmpeg-cvslog mailing list