diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-05-16 15:37:24 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-05-16 15:39:28 +0200 |
commit | 8767470fb572f394104d24acffb70eea9ce48ad3 (patch) | |
tree | fe2d58a58f952ba563b9f70125bb209b1ad5c29d /libavcodec/iff.c | |
parent | 635b2ec5f20d6cdef1adf4907ca28f8f09abcecc (diff) | |
download | ffmpeg-8767470fb572f394104d24acffb70eea9ce48ad3.tar.gz |
avcodec/iff: check if there is enough bytes left
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r-- | libavcodec/iff.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index eef7ce18fd..85fae1589e 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -850,6 +850,9 @@ static void decode_delta_j(uint8_t *dst, for (g = 0; g < groups; g++) { offset = bytestream2_get_be16(&gb); + if (bytestream2_get_bytes_left(&gb) < 1) + return; + if (kludge_j) offset = ((offset / (320 / 8)) * pitch) + (offset % (320 / 8)) - kludge_j; else @@ -893,6 +896,9 @@ static void decode_delta_j(uint8_t *dst, for (d = 0; d < bpp; d++) { unsigned noffset = offset + (r * pitch) + d * planepitch; + if (bytestream2_get_bytes_left(&gb) < 1) + return; + for (b = 0; b < bytes; b++) { uint8_t value = bytestream2_get_byte(&gb); |