[FFmpeg-devel,7/8] tools/target_dec_fuzzer: Update maxpixels_per_frame for low thresholds

Message ID 20210201223116.11378-7-michael@niedermayer.cc
State Accepted
Commit be0c72b7c29324f42afd14f150eb9cdb83788ca0
Headers
Series [FFmpeg-devel,1/8] avcodec/cbs_sei_syntax_template: Check for non negativity before setting size_t bits_left |

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Feb. 1, 2021, 10:31 p.m. UTC
Fixes: Timeout
Fixes: 29990/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS2_fuzzer-5469155073589248

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_dec_fuzzer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Michael Niedermayer Feb. 16, 2021, 5:15 p.m. UTC | #1
On Mon, Feb 01, 2021 at 11:31:15PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 29990/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS2_fuzzer-5469155073589248
> 
> 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_dec_fuzzer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply

[...]
  

Patch

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index affa6e3b51..728a6bb065 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -98,7 +98,7 @@  static int audio_video_handler(AVCodecContext *avctx, AVFrame *frame,
 
 // Ensure we don't loop forever
 const uint32_t maxiteration = 8096;
-const uint64_t maxpixels_per_frame = 4096 * 4096;
+uint64_t maxpixels_per_frame = 4096 * 4096;
 uint64_t maxpixels;
 
 uint64_t maxsamples_per_frame = 256*1024*32;
@@ -194,6 +194,7 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     }
 
     maxsamples_per_frame = FFMIN(maxsamples_per_frame, maxsamples);
+    maxpixels_per_frame  = FFMIN(maxpixels_per_frame , maxpixels);
 
     AVCodecContext* ctx = avcodec_alloc_context3(c);
     AVCodecContext* parser_avctx = avcodec_alloc_context3(NULL);