aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-05 22:17:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:33 +0200
commit51b8a78851da3895b993139e708fc0f1a665e605 (patch)
tree93af69f0aec5e3d458c4aab4ff44a12f6c4efb31
parent1e9fa7c69fdc1a2cf2a716b818e5cdad28333f6c (diff)
downloadffmpeg-51b8a78851da3895b993139e708fc0f1a665e605.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 17109d9a93..61ca012dc9 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -112,11 +112,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;
}
}