avcodec/vmixdec: Fix several integer anomalies

Fixes: vmixdec.c:132:34: runtime error: signed integer overflow: -2147483648 * 1856 cannot be represented in type 'int'
Fixes: vmixdec.c:119:20: runtime error: signed integer overflow: -1256 + -2147483648 cannot be represented in type 'int'
Fixes: vmixdec.c:137:36: runtime error: signed integer overflow: 2147483416 * 16 cannot be represented in type 'int'
Fixes: 59843/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-4857434624360448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-06-18 22:41:01 +02:00
parent 673862e947
commit 574f3aaeff
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ static int decode_dcac(AVCodecContext *avctx,
dc_run--;
} else {
dc_v = get_se_golomb_vmix(dc_gb);
dc += dc_v;
dc += (unsigned)dc_v;
if (!dc_v)
dc_run = get_ue_golomb_long(dc_gb);
}
@ -129,12 +129,12 @@ static int decode_dcac(AVCodecContext *avctx,
ac_v = get_se_golomb_vmix(ac_gb);
i = scan[n];
block[i] = (ac_v * factors[i]) >> 4;
block[i] = ((unsigned)ac_v * factors[i]) >> 4;
if (!ac_v)
ac_run = get_ue_golomb_long(ac_gb);
}
block[0] = ((dc + add) * 16) >> 4;
block[0] = dc + add;
s->idsp.idct_put(dst + x, linesize, block);
}