History

avcodec/iff: Use signed count

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

Michael Niedermayer committed 2 years ago

Commit cfe66df1 parent 1e888fb1 file · +2 −2Browse files

Unified · Split

libavcodec/iff.c+2−2
@@ -523,7 +523,7 @@ static int decode_byterun2(uint8_t *dst, int height, int line_size, · 522 unmodified lines
523 GetByteContext *gb)523 GetByteContext *gb)
524{524{
525 GetByteContext cmds;525 GetByteContext cmds;
526 unsigned count;526 int count;
527 int i, y_pos = 0, x_pos = 0;527 int i, y_pos = 0, x_pos = 0;
528 528
529 if (bytestream2_get_be32(gb) != MKBETAG('V', 'D', 'A', 'T'))529 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, · 1 unmodified line
531 531
532 bytestream2_skip(gb, 4);532 bytestream2_skip(gb, 4);
533 count = bytestream2_get_be16(gb) - 2;533 count = bytestream2_get_be16(gb) - 2;
534 if (bytestream2_get_bytes_left(gb) < count)534 if (count < 0 || bytestream2_get_bytes_left(gb) < count)
535 return 0;535 return 0;
536 536
537 bytestream2_init(&cmds, gb->buffer, count);537 bytestream2_init(&cmds, gb->buffer, count);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t