[FFmpeg-cvslog] pngdec: Stop trying to decode once inflate returns Z_STREAM_END
Martin Storsjö
git at videolan.org
Thu Jan 16 22:36:39 CET 2014
ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Sun Sep 29 00:12:04 2013 +0300| [ac1e61d5593d987876e2947b42a7aa37a4efcd4e] | committer: Luca Barbato
pngdec: Stop trying to decode once inflate returns Z_STREAM_END
If the input buffer contains more data after the deflate stream,
the loop previously left running infinitely, with inflate returning
Z_STREAM_END.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit a81cad8f86d1feb7e4bfae29e43f3e994935a5c7)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit a63e83cd4b43c3dcef38f7fefe41c002a263af0f)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac1e61d5593d987876e2947b42a7aa37a4efcd4e
---
libavcodec/pngdec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index ac98f70..22f154e 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -377,6 +377,10 @@ 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 && s->zstream.avail_in > 0) {
+ av_log(NULL, AV_LOG_WARNING, "%d undecompressed bytes left in buffer\n", s->zstream.avail_in);
+ return 0;
+ }
}
return 0;
}
More information about the ffmpeg-cvslog
mailing list