Decode png images without iend chunk.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 11 Mar 2014 08:56:38 +0000 (09:56 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 11 Mar 2014 08:56:38 +0000 (09:56 +0100)
Fixes ticket #3357.

libavcodec/pngdec.c

index 516dd41..985517d 100644 (file)
@@ -546,6 +546,9 @@ static int decode_frame(AVCodecContext *avctx,
     for (;;) {
         if (bytestream2_get_bytes_left(&s->gb) <= 0) {
             av_log(avctx, AV_LOG_ERROR, "No bytes left\n");
+            if (   s->state & PNG_ALLIMAGE
+                && avctx->strict_std_compliance <= FF_COMPLIANCE_NORMAL)
+                goto exit_loop;
             goto fail;
         }