[FFmpeg-cvslog] webp: Make sure enough bytes are available

Andreas Cadhalpun git at videolan.org
Fri Jul 3 04:14:38 CEST 2015


ffmpeg | branch: master | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Fri Jul  3 01:14:51 2015 +0200| [76d4c62734fbb8a9f497712812f30ff5c27e787f] | committer: Luca Barbato

webp: Make sure enough bytes are available

Every chunk needs at least 8 bytes for chunk_type and chunk_size.
Prevent a possible infinite loop.

CC: libav-stable at libav.org
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76d4c62734fbb8a9f497712812f30ff5c27e787f
---

 libavcodec/webp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 62f35f7..4138e54 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1362,7 +1362,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_INVALIDDATA;
     }
 
-    while (bytestream2_get_bytes_left(&gb) > 0) {
+    while (bytestream2_get_bytes_left(&gb) > 8) {
         char chunk_str[5] = { 0 };
 
         chunk_type = bytestream2_get_le32(&gb);



More information about the ffmpeg-cvslog mailing list