From 65bf9a44d7b0295e03463fd143499ab5b85d0cb7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 25 Sep 2013 02:08:04 +0200 Subject: [PATCH] avcodec/pngdec: check for stream end in png_decode_idat() Fix infinite loop Fix Ticket2978 Signed-off-by: Michael Niedermayer --- libavcodec/pngdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index cee97b321e..18295c550e 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -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; }