Browse Source

avcodec/iff: add forgotten checks for end of input buffer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n3.1
Paul B Mahol 9 years ago
parent
commit
810a8ba5b6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/iff.c

+ 2
- 2
libavcodec/iff.c View File

@@ -1247,7 +1247,7 @@ static void decode_delta_d(uint8_t *dst,
bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc)); bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc));


entries = bytestream2_get_be32(&gb); entries = bytestream2_get_be32(&gb);
while (entries) {
while (entries && bytestream2_get_bytes_left(&gb) >= 8) {
int32_t opcode = bytestream2_get_be32(&gb); int32_t opcode = bytestream2_get_be32(&gb);
unsigned offset = 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)); bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc));


entries = bytestream2_get_be16(&gb); entries = bytestream2_get_be16(&gb);
while (entries) {
while (entries && bytestream2_get_bytes_left(&gb) >= 6) {
int16_t opcode = bytestream2_get_be16(&gb); int16_t opcode = bytestream2_get_be16(&gb);
unsigned offset = bytestream2_get_be32(&gb); unsigned offset = bytestream2_get_be32(&gb);




Loading…
Cancel
Save