From 76d4c62734fbb8a9f497712812f30ff5c27e787f Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Fri, 3 Jul 2015 01:14:51 +0200 Subject: 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@libav.org Signed-off-by: Luca Barbato --- libavcodec/webp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/webp.c') diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 62f35f7480..4138e5414f 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); -- cgit v1.2.3