avcodec/pngdec: check for stream end in png_decode_idat()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Sep 2013 00:08:04 +0000 (02:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Sep 2013 00:17:36 +0000 (02:17 +0200)
Fix infinite loop
Fix Ticket2978

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c

index cee97b3..18295c5 100644 (file)
@@ -381,6 +381,8 @@ static int png_decode_idat(PNGDecContext *s, int length)
             s->zstream.avail_out = s->crow_size;
             s->zstream.next_out  = s->crow_buf;
         }
+        if (ret == Z_STREAM_END)
+            break;
     }
     return 0;
 }