Found by code review related to CID1604386 Overflowed constant
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -240,7 +240,7 @@ static int get_opcodes(GetByteContext *gb, uint32_t *table, uint8_t *dst, int op · 239 unmodified lines | |||
| 240 | 240 | ||
| 241 | size_in_bits = bytestream2_get_le32(gb); | 241 | size_in_bits = bytestream2_get_le32(gb); |
| 242 | endoffset = ((size_in_bits + 7) >> 3) - 4; | 242 | endoffset = ((size_in_bits + 7) >> 3) - 4; |
| 243 | if (endoffset <= 0 || bytestream2_get_bytes_left(gb) < endoffset) | 243 | if ((int)endoffset <= 0 || bytestream2_get_bytes_left(gb) < endoffset) |
| 244 | return AVERROR_INVALIDDATA; | 244 | return AVERROR_INVALIDDATA; |
| 245 | 245 | ||
| 246 | offset = endoffset; | 246 | offset = endoffset; |