diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-09-02 22:42:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 21:34:53 +0200 |
commit | 322563a61dd59c340df08449f4a870577b991c3f (patch) | |
tree | 551e41061fec34ffa3e74a78641c2d10de7a1cfa | |
parent | 3294678d1807eaa05384e2e6c035caa683bbd04c (diff) | |
download | ffmpeg-322563a61dd59c340df08449f4a870577b991c3f.tar.gz |
avcodec/vc1_block: Fix integer overflow in ac value
Fixes: signed integer overflow: 25488 * 87381 cannot be represented in type 'int'
Fixes: 24765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5108259565076480
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 3056e19e68122b9464b24870488f8faca4e78ea8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vc1_block.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 381241b22c..ad1f3d2893 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1056,7 +1056,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, if (q1 < 1) return AVERROR_INVALIDDATA; for (k = 1; k < 8; k++) - ac_val2[k] = (ac_val2[k] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18; + ac_val2[k] = (int)(ac_val2[k] * (unsigned)q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18; } } } else { // top @@ -1068,7 +1068,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, if (q1 < 1) return AVERROR_INVALIDDATA; for (k = 1; k < 8; k++) - ac_val2[k + 8] = (ac_val2[k + 8] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18; + ac_val2[k + 8] = (int)(ac_val2[k + 8] * (unsigned)q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18; } } } |