summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/iff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index f82141d2e7..d826e78089 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -1354,6 +1354,9 @@ static void decode_delta_d(uint8_t *dst,
bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc));
entries = bytestream2_get_be32(&gb);
+ if (entries * 8LL > bytestream2_get_bytes_left(&gb))
+ return;
+
while (entries && bytestream2_get_bytes_left(&gb) >= 8) {
int32_t opcode = bytestream2_get_be32(&gb);
unsigned offset = bytestream2_get_be32(&gb);