[FFmpeg-cvslog] tools/target_dec_fuzzer: limit per frame samples for APE

Michael Niedermayer git at videolan.org
Fri Jan 31 01:14:06 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Jan 10 22:39:47 2020 +0100| [32522b530779e155001b1a45e764d8185aa189e1] | committer: Michael Niedermayer

tools/target_dec_fuzzer: limit per frame samples for APE

APE in its highest compression mode is really slow so even one frame
of millions of samples takes a long time

Fixes: Timeout (too long -> 3sec)
Fixes: 19937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5751668818051072

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 tools/target_dec_fuzzer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 752df43a64..2487b6ca94 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -93,7 +93,7 @@ const uint32_t maxiteration = 8096;
 const uint64_t maxpixels_per_frame = 4096 * 4096;
 uint64_t maxpixels;
 
-const uint64_t maxsamples_per_frame = 256*1024*32;
+uint64_t maxsamples_per_frame = 256*1024*32;
 uint64_t maxsamples;
 
 static const uint64_t FUZZ_TAG = 0x4741542D5A5A5546ULL;
@@ -133,6 +133,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     case AVMEDIA_TYPE_VIDEO   : decode_handler = avcodec_decode_video2; break;
     case AVMEDIA_TYPE_SUBTITLE: decode_handler = subtitle_handler     ; break;
     }
+    switch (c->id) {
+    case AV_CODEC_ID_APE:       maxsamples_per_frame /= 256; break;
+    }
     maxpixels = maxpixels_per_frame * maxiteration;
     maxsamples = maxsamples_per_frame * maxiteration;
     switch (c->id) {



More information about the ffmpeg-cvslog mailing list