Browse Source

avcodec/ptx: Check that the input contains at least one line

Fixes: Timeout (19sec -> 44ms)
Fixes: 17816/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PTX_fuzzer-5704459950227456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a6ad328256)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.15
Michael Niedermayer 6 years ago
parent
commit
5cc96ce0e7
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/ptx.c

+ 3
- 0
libavcodec/ptx.c View File

@@ -55,6 +55,9 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,

buf += offset;

if (buf_end - buf < w * bytes_per_pixel)
return AVERROR_INVALIDDATA;

if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
return ret;



Loading…
Cancel
Save