Found by reviewing code related to CID1604365 Overflowed constant
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -231,8 +231,8 @@ static int read_high_coeffs(AVCodecContext *avctx, const uint8_t *src, int16_t * · 230 unmodified lines | ||
| 231 | 231 | if (cnt1 >= length) { |
| 232 | 232 | cnt1 = get_bits(bc, nbits); |
| 233 | 233 | } else { |
| 234 | − pfx = 14 + ((((uint64_t)(value - 14)) >> 32) & (value - 14)); | |
| 235 | − if (pfx < 1 || pfx > 25) | |
| 234 | + pfx = FFMIN(value, 14); | |
| 235 | + if (pfx < 1) | |
| 236 | 236 | return AVERROR_INVALIDDATA; |
| 237 | 237 | cnt1 *= (1 << pfx) - 1; |
| 238 | 238 | shbits = show_bits(bc, pfx); |