Skip to content

Commit

Permalink
tools/target_swr_fuzzer: Limit the number of samples
Browse files Browse the repository at this point in the history
Fixes: OOM and Timeout
Fixes: 71254/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-5941896977907712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Sep 24, 2024
1 parent 5ded752 commit 6190e82
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/target_swr_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
in_sample_nb = size / (in_ch_count * av_get_bytes_per_sample(in_sample_fmt));
out_sample_nb = out_sample_nb % (av_rescale(in_sample_nb, 2*out_sample_rate, in_sample_rate) + 1);

if (in_sample_nb > 1000*1000 || out_sample_nb > 1000*1000)
goto end;

out_data = av_malloc(out_sample_nb * out_ch_count * av_get_bytes_per_sample(out_sample_fmt));
if (!out_data)
goto end;
Expand Down

0 comments on commit 6190e82

Please sign in to comment.