diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 647e7f0a74..395b86bbe7 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1597,6 +1597,8 @@ static int decode_frame_lscr(AVCodecContext *avctx, if (avpkt->size < 2) return AVERROR_INVALIDDATA; + if (avpkt->size == 2) + return 0; bytestream2_init(gb, avpkt->data, avpkt->size);