avcodec/pngdec: check for stream end in png_decode_idat()

Fix infinite loop
Fix Ticket2978

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-25 02:08:04 +02:00
parent bb4b041df3
commit 65bf9a44d7

View File

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