diff options
-rw-r--r-- | libavcodec/pngdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 6a681be29d..7fcf83e347 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -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); |