diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-04-24 18:16:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-07-23 18:07:36 +0200 |
commit | 40cec0b46570bb27a5a0145ceab932d0318e6e52 (patch) | |
tree | 0f6b37058103a3b5116b91a29cd651302ceaf847 /libavcodec | |
parent | 071c625ad71ce328075408d564bbd9d6fbd42c5b (diff) | |
download | ffmpeg-40cec0b46570bb27a5a0145ceab932d0318e6e52.tar.gz |
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
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wavarc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c index 6daad6a5a1..8e4c7d17dc 100644 --- a/libavcodec/wavarc.c +++ b/libavcodec/wavarc.c @@ -205,7 +205,7 @@ static int decode_1dif(AVCodecContext *avctx, if (block_type < 4 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -297,7 +297,7 @@ static int decode_2slp(AVCodecContext *avctx, if (block_type < 5 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } |