]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pngdec.c
avcodec/pngdec: Check length in fdAT
[ffmpeg] / libavcodec / pngdec.c
index d72f9bbb80a62f74b650d63b397f28e87a194a32..86f885bbee131126f77cace1354806cbfde735f7 100644 (file)
@@ -1252,7 +1252,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
         case MKTAG('f', 'd', 'A', 'T'):
             if (!CONFIG_APNG_DECODER || avctx->codec_id != AV_CODEC_ID_APNG)
                 goto skip_tag;
-            if (!decode_next_dat) {
+            if (!decode_next_dat || length < 4) {
                 ret = AVERROR_INVALIDDATA;
                 goto fail;
             }