[FFmpeg-cvslog] tools/target_dec_fuzzer: check max samples in flush loop

Michael Niedermayer git at videolan.org
Fri Aug 6 22:05:25 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug  1 18:31:31 2021 +0200| [c42f277903028627fb916b72704fd0ccc83d4af2] | committer: Michael Niedermayer

tools/target_dec_fuzzer: check max samples in flush loop

Fixes: Timeout
Fixes: 36020/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4774629855068160

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 0195d8910e..c0e59983c4 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -441,6 +441,10 @@ maximums_reached:
         got_frame = 0;
         av_frame_unref(frame);
         decode_handler(ctx, frame, &got_frame, avpkt);
+
+        nb_samples += frame->nb_samples;
+        if (nb_samples > maxsamples)
+            break;
     } while (got_frame == 1 && it++ < maxiteration);
 
     fprintf(stderr, "pixels decoded: %"PRId64", samples decoded: %"PRId64", iterations: %d\n", ec_pixels, nb_samples, it);



More information about the ffmpeg-cvslog mailing list