diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-08-01 18:31:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-08-06 21:04:43 +0200 |
commit | c42f277903028627fb916b72704fd0ccc83d4af2 (patch) | |
tree | 382ab905c620c864c29320c9ae40fc620190b645 /tools/target_dec_fuzzer.c | |
parent | e6754d2ad20c918735d3bf5cc8122ac57f53d03c (diff) | |
download | ffmpeg-c42f277903028627fb916b72704fd0ccc83d4af2.tar.gz |
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@niedermayer.cc>
Diffstat (limited to 'tools/target_dec_fuzzer.c')
-rw-r--r-- | tools/target_dec_fuzzer.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |