aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-05 02:21:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-12 22:42:28 +0200
commitcfe66dfebb8a1e1394bcf834b6cc785f280ccecf (patch)
tree07456762ece60b46402c9e7aec3b5fe6bc384e71
parent1e888fb006daf1edb5d853de2f66a6caeb2dce13 (diff)
downloadffmpeg-cfe66dfebb8a1e1394bcf834b6cc785f280ccecf.tar.gz
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>
-rw-r--r--libavcodec/iff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 4b3e8e0c21..13010b451e 100644
--- a/libavcodec/iff.c
+++ b/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);