aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/iff.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-05-14 14:29:59 +0200
committerPaul B Mahol <onemda@gmail.com>2016-05-14 14:29:59 +0200
commit51a1c1c6ac98d1d0d0a654f066782707af092fed (patch)
tree32b38756d50f8926b3c057f91319d46ee5b34b25 /libavcodec/iff.c
parentd680ab1c46b6229e4289daec927402d72fb2c94d (diff)
downloadffmpeg-51a1c1c6ac98d1d0d0a654f066782707af092fed.tar.gz
avcodec/iff: check for end of buffer in input for delta_l decompression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r--libavcodec/iff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 3225524e73..674a5c2b9d 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -1248,7 +1248,7 @@ static void decode_delta_l(uint8_t *dst,
bytestream2_init(&dgb, buf + 2 * poff0, buf_end - (buf + 2 * poff0));
bytestream2_init(&ogb, buf + 2 * poff1, buf_end - (buf + 2 * poff1));
- while ((bytestream2_peek_be16(&ogb)) != 0xFFFF) {
+ while ((bytestream2_peek_be16(&ogb)) != 0xFFFF && bytestream2_get_bytes_left(&ogb) >= 4) {
uint32_t offset = bytestream2_get_be16(&ogb);
int16_t cnt = bytestream2_get_be16(&ogb);
uint16_t data;