diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-05 22:17:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-17 20:35:19 +0200 |
commit | d0947505dc970155f78acfc5f5a0bac60cda3e2b (patch) | |
tree | de9380d420131cb44998b27508f3f8d013f25baf | |
parent | c93df94fe30fb3758070cd16cbe9660c7bf117f1 (diff) | |
download | ffmpeg-d0947505dc970155f78acfc5f5a0bac60cda3e2b.tar.gz |
avcodec/mdec: Fix signed integer overflow: 28835400 * 83 cannot be represented in type 'int'
Fixes: 1346/clusterfuzz-testcase-minimized-5776732600664064
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a234b5ade3ca6cde805b92b8b6ecacf693460a8c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/mdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 42bd561cd7..8e28aa04f0 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -111,11 +111,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) j = scantable[i]; if (level < 0) { level = -level; - level = (level * qscale * quant_matrix[j]) >> 3; + level = (level * (unsigned)qscale * quant_matrix[j]) >> 3; level = (level - 1) | 1; level = -level; } else { - level = (level * qscale * quant_matrix[j]) >> 3; + level = (level * (unsigned)qscale * quant_matrix[j]) >> 3; level = (level - 1) | 1; } } |