Commit 4fd74a2b authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pngdec: Check nb_blocks

Fixes: Timeout (23sec -> 0.5sec)
Fixes: 14329/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-5679252923482112

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 1eb54323
......@@ -1541,6 +1541,8 @@ 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)
return AVERROR_INVALIDDATA;
if (s->last_picture.f->data[0]) {
ret = av_frame_copy(frame, s->last_picture.f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment