Module: libav
Branch: release/11
Commit: bd6ca558158b068fb032a2c5bca4e7f637cfc427

Author:    Andreas Cadhalpun <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Fri Jul  3 01:14:51 2015 +0200

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: [email protected]
Signed-off-by: Luca Barbato <[email protected]>

---

 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);

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to