diff mbox series

[FFmpeg-devel,03/10] tools/target_swr_fuzzer: Limit the number of samples

Message ID 20240922215645.1182935-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/10] tools/target_dec_fuzzer: Add threshold for SRGC | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Sept. 22, 2024, 9:56 p.m. UTC
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>
---
 tools/target_swr_fuzzer.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Sept. 24, 2024, 1:23 p.m. UTC | #1
On Sun, Sep 22, 2024 at 11:56:38PM +0200, Michael Niedermayer wrote:
> 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>
> ---
>  tools/target_swr_fuzzer.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/tools/target_swr_fuzzer.c b/tools/target_swr_fuzzer.c
index b6cdb72a560..9192d4bed50 100644
--- a/tools/target_swr_fuzzer.c
+++ b/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;