Browse Source

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>
tags/n2.8
Andreas Cadhalpun Luca Barbato 10 years ago
parent
commit
76d4c62734
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/webp.c

+ 1
- 1
libavcodec/webp.c View File

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


Loading…
Cancel
Save