summaryrefslogtreecommitdiff
path: root/libavcodec/iff.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-05-18 12:46:43 +0200
committerPaul B Mahol <onemda@gmail.com>2016-05-18 12:46:43 +0200
commit810a8ba5b67389e808ed2f124e1cd54b8a26e679 (patch)
treecdbab3aa484dbd6e5f5b4ca68e92c86d9f29ea65 /libavcodec/iff.c
parenteef2f64294a66e24f45d219ae0c715eabdd6bf3d (diff)
avcodec/iff: add forgotten checks for end of input buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r--libavcodec/iff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 5b819c8daa..dc3cb4b80f 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -1247,7 +1247,7 @@ static void decode_delta_d(uint8_t *dst,
bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc));
entries = bytestream2_get_be32(&gb);
- while (entries) {
+ while (entries && bytestream2_get_bytes_left(&gb) >= 8) {
int32_t opcode = bytestream2_get_be32(&gb);
unsigned offset = bytestream2_get_be32(&gb);
@@ -1302,7 +1302,7 @@ static void decode_delta_e(uint8_t *dst,
bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc));
entries = bytestream2_get_be16(&gb);
- while (entries) {
+ while (entries && bytestream2_get_bytes_left(&gb) >= 6) {
int16_t opcode = bytestream2_get_be16(&gb);
unsigned offset = bytestream2_get_be32(&gb);