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
523523 GetByteContext *gb)
524524 {
525525 GetByteContext cmds;
526− unsigned count;
526+ int count;
527527 int i, y_pos = 0, x_pos = 0;
528528
529529 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
531531
532532 bytestream2_skip(gb, 4);
533533 count = bytestream2_get_be16(gb) - 2;
534− if (bytestream2_get_bytes_left(gb) < count)
534+ if (count < 0 || bytestream2_get_bytes_left(gb) < count)
535535 return 0;
536536
537537 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