aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-09-21 01:10:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-10-03 20:09:27 +0200
commit9cef555bc52e26e674b0c3988bb20a08315e76e1 (patch)
treef4ba4c3d0e618d87a94c94b4eb763fea89c3fee2 /libavcodec
parentdbcf285abdc7921b065491862be048bdd0c9289d (diff)
downloadffmpeg-9cef555bc52e26e674b0c3988bb20a08315e76e1.tar.gz
avcodec/wavarc: Check k in decode_5elp()
regression since 18b2ecc24778140c2bc798ed64842dc8feb6dc3a Fixes: assertion failure Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6280165808013312 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c
index d12b826852..09ed4d473a 100644
--- a/libavcodec/wavarc.c
+++ b/libavcodec/wavarc.c
@@ -539,6 +539,8 @@ static int decode_5elp(AVCodecContext *avctx,
if (block_type >= 0 && block_type <= 7) {
k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P);
k = get_urice(gb, k) + 1;
+ if (k >= 32)
+ return AVERROR_INVALIDDATA;
}
if (block_type <= 2 || block_type == 6 || block_type == 13 ||