diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-22 01:03:15 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-11 20:13:21 +0300 |
commit | 70432eac0b511105a5d6654cb794bc5f3e983ee0 (patch) | |
tree | abaa419e3b618bb814ae9a7f66d9fc398e1f8de9 | |
parent | c9415e815a996d287850a3572ce2c1d663b9f657 (diff) |
avcodec/pngdec: consider chunk size in minimal size check
assuming each block contains an empty chunk there has to be at least 8 bytes extra.
Fixes: 15327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-5676669303521280
Fixes: Timeout (11->5sec)
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/pngdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index bf5a5191cc..cad5796545 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1547,7 +1547,7 @@ static int decode_frame_lscr(AVCodecContext *avctx, return ret; nb_blocks = bytestream2_get_le16(gb); - if (bytestream2_get_bytes_left(gb) < 2 + nb_blocks * 12) + if (bytestream2_get_bytes_left(gb) < 2 + nb_blocks * (12 + 8)) return AVERROR_INVALIDDATA; if (s->last_picture.f->data[0]) { |