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>
(cherry picked from commit 70b26b693e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 9 months ago
parent b171edca3c
commit e2a58916b1
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      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;

Loading…
Cancel
Save