summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-02-18 23:08:59 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-02-25 21:19:58 +0100
commite4eed311332fe329eef6bc8e9d7606a206c99469 (patch)
tree6219e68ea647295368aef55f1c7c76419ac0202a
parentc56f84e656cda5463ee1cf747f8e469252ce42ce (diff)
downloadffmpeg-e4eed311332fe329eef6bc8e9d7606a206c99469.tar.gz
avcodec/wavarc: Check k
Fixes: Assertion failure Fixes: 55849/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6590105973555200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4dee46426e6d23adda048414433c2887314a4267) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wavarc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c
index b626daa66e..8d37af9571 100644
--- a/libavcodec/wavarc.c
+++ b/libavcodec/wavarc.c
@@ -192,6 +192,8 @@ 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)
+ return AVERROR_INVALIDDATA;
}
switch (block_type) {
@@ -282,6 +284,8 @@ 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)
+ return AVERROR_INVALIDDATA;
}
switch (block_type) {