The implementation does not support k=32 Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 57976/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5911925807775744
Unified · Split
| @@ -205,7 +205,7 @@ static int decode_1dif(AVCodecContext *avctx, · 204 unmodified lines | |||
| 205 | if (block_type < 4 && block_type >= 0) { | 205 | if (block_type < 4 && block_type >= 0) { |
| 206 | k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); | 206 | k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); |
| 207 | k = get_urice(gb, k) + 1; | 207 | k = get_urice(gb, k) + 1; |
| 208 | if (k > 32) | 208 | if (k >= 32) |
| 209 | return AVERROR_INVALIDDATA; | 209 | return AVERROR_INVALIDDATA; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| @@ -297,7 +297,7 @@ static int decode_2slp(AVCodecContext *avctx, · 85 unmodified lines | |||
| 297 | if (block_type < 5 && block_type >= 0) { | 297 | if (block_type < 5 && block_type >= 0) { |
| 298 | k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); | 298 | k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); |
| 299 | k = get_urice(gb, k) + 1; | 299 | k = get_urice(gb, k) + 1; |
| 300 | if (k > 32) | 300 | if (k >= 32) |
| 301 | return AVERROR_INVALIDDATA; | 301 | return AVERROR_INVALIDDATA; |
| 302 | } | 302 | } |
| 303 | 303 | ||