avcodec/iff: Use signed count

This is more a style fix than a bugfix (CID1604392 Overflowed constant)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 7 months ago
parent 1e888fb006
commit cfe66dfebb
  1. 4
      libavcodec/iff.c

@ -523,7 +523,7 @@ static int decode_byterun2(uint8_t *dst, int height, int line_size,
GetByteContext *gb)
{
GetByteContext cmds;
unsigned count;
int count;
int i, y_pos = 0, x_pos = 0;
if (bytestream2_get_be32(gb) != MKBETAG('V', 'D', 'A', 'T'))
@ -531,7 +531,7 @@ static int decode_byterun2(uint8_t *dst, int height, int line_size,
bytestream2_skip(gb, 4);
count = bytestream2_get_be16(gb) - 2;
if (bytestream2_get_bytes_left(gb) < count)
if (count < 0 || bytestream2_get_bytes_left(gb) < count)
return 0;
bytestream2_init(&cmds, gb->buffer, count);

Loading…
Cancel
Save