diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-28 21:19:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:46 +0100 |
commit | 0dc659b8fbe5a7af4a25123481a855b75291f1de (patch) | |
tree | 78f91ea0de98762872fbca3b0d5570bb913d825c | |
parent | c992a8301a3467572003e55e6f4da91e3919daaf (diff) | |
download | ffmpeg-0dc659b8fbe5a7af4a25123481a855b75291f1de.tar.gz |
avcodec/vc1_block: Fixes integer overflow in vc1_decode_i_block_adv()
Fixes: signed integer overflow: 62220 * 262144 cannot be represented in type 'int'
Fixes: 17145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5667394743173120
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 6fdeb208172dc95b29b965a0cc365ca0925e151e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vc1_block.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index f61bf9a7f0..51a2f41316 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -825,7 +825,7 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, return AVERROR_INVALIDDATA; q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1; for (k = 1; k < 8; k++) - block[k << sh] += (ac_val[k] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18; + block[k << sh] += (int)(ac_val[k] * (unsigned)q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18; } else { for (k = 1; k < 8; k++) block[k << sh] += ac_val[k]; |