aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-03-20 03:30:56 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-25 21:41:26 +0100
commit70b26b693e9e06bcd9fe83ee5063ee40e32ce02f (patch)
treefc26b2f6cb06c02249ca50220fd6fd292ca050a2
parent3c43299e9e642e73b31be7ac7c49700949946e13 (diff)
downloadffmpeg-70b26b693e9e06bcd9fe83ee5063ee40e32ce02f.tar.gz
avcodec/vmixdec: Check shift before use
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 65909/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-519459745831321 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vmixdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vmixdec.c b/libavcodec/vmixdec.c
index d6b6e3557f..ab283d13db 100644
--- a/libavcodec/vmixdec.c
+++ b/libavcodec/vmixdec.c
@@ -235,6 +235,9 @@ static int decode_frame(AVCodecContext *avctx,
else if (offset != 3)
return AVERROR_INVALIDDATA;
+ if (s->lshift > 31)
+ return AVERROR_INVALIDDATA;
+
q = quality[FFMIN(avpkt->data[offset - 2], FF_ARRAY_ELEMS(quality)-1)];
for (int n = 0; n < 64; n++)
s->factors[n] = quant[n] * q;