mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-14 03:11:25 +00:00
avcodec/iff: decode_delta_j: Check that the number of bytes that will be read are available
This should avoid long loops related to CID1361958 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3f5b7a2d73
commit
fcdbbbd85a
1 changed files with 2 additions and 2 deletions
|
|
@ -865,7 +865,7 @@ 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)
|
||||
if (cols * bpp == 0 || bytestream2_get_bytes_left(&gb) < cols * bpp)
|
||||
return;
|
||||
|
||||
if (kludge_j)
|
||||
|
|
@ -911,7 +911,7 @@ 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)
|
||||
if (!bytes || bytestream2_get_bytes_left(&gb) < bytes)
|
||||
return;
|
||||
|
||||
for (b = 0; b < bytes; b++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue