History

avcodec/wavarc: Fix k limit

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

Michael Niedermayer committed 3 years ago

Commit 40cec0b1 parent 071c6251 file · +2 −2Browse files

Unified · Split

libavcodec/wavarc.c+2−2
@@ -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

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