avcodec/vmixdec: Check for end of input in decode_dcac()

Fixes: Timeout
Fixes: 59952/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-6718213736759296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d4847618
......@@ -115,6 +115,8 @@ static int decode_dcac(AVCodecContext *avctx,
if (dc_run > 0) {
dc_run--;
} else {
if (get_bits_left(dc_gb) < 1)
return AVERROR_INVALIDDATA;
dc_v = get_se_golomb_vmix(dc_gb);
dc += (unsigned)dc_v;
if (!dc_v)
......@@ -127,6 +129,8 @@ static int decode_dcac(AVCodecContext *avctx,
continue;
}
if (get_bits_left(ac_gb) < 1)
return AVERROR_INVALIDDATA;
ac_v = get_se_golomb_vmix(ac_gb);
i = scan[n];
block[i] = ((unsigned)ac_v * factors[i]) >> 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment