This is more a style fix than a bugfix (CID1604392 Overflowed constant)
Unified · Split
| @@ -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); |