tools/target_swr_fuzzer: Limit the number of samples

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 <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 2 months ago
parent 5ded752241
commit 6190e82647
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      tools/target_swr_fuzzer.c

@ -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;

Loading…
Cancel
Save