Commit 8767470f authored by Paul B Mahol's avatar Paul B Mahol

avcodec/iff: check if there is enough bytes left

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 635b2ec5
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment