summaryrefslogtreecommitdiff
path: root/libavcodec/webp.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-07-03 01:14:51 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-07-03 01:50:09 +0200
commit76d4c62734fbb8a9f497712812f30ff5c27e787f (patch)
tree4afda2e7ea5b19a8feb7b006aaec135e41a2dc7c /libavcodec/webp.c
parent016cac75c6061a1c03f812ddf258b8baefe70b00 (diff)
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 <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/webp.c')
-rw-r--r--libavcodec/webp.c2
1 files changed, 1 insertions, 1 deletions
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);