Commit a234b5ad authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 470ad23a
...@@ -111,11 +111,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) ...@@ -111,11 +111,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
j = scantable[i]; j = scantable[i];
if (level < 0) { if (level < 0) {
level = -level; level = -level;
level = (level * qscale * quant_matrix[j]) >> 3; level = (level * (unsigned)qscale * quant_matrix[j]) >> 3;
level = (level - 1) | 1; level = (level - 1) | 1;
level = -level; level = -level;
} else { } else {
level = (level * qscale * quant_matrix[j]) >> 3; level = (level * (unsigned)qscale * quant_matrix[j]) >> 3;
level = (level - 1) | 1; level = (level - 1) | 1;
} }
} }
......
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