aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-08 15:40:30 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:33 +0200
commitfbeb8c760cf5d9429a2e9af42b928418eda9f7d8 (patch)
tree63a7b9461950805a6c238626748e9bc8b3a6f718
parente7d36d262ea944b1003c79e9dfec3b256fe73f98 (diff)
downloadffmpeg-fbeb8c760cf5d9429a2e9af42b928418eda9f7d8.tar.gz
avcodec/dss_sp: Fix multiple runtime error: signed integer overflow: -15699 * -164039 cannot be represented in type 'int'
Fixed: 1409/clusterfuzz-testcase-minimized-5237365020819456 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 ea59ef0c031b6b92f051f60c19fdd0a716769834) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/dss_sp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dss_sp.c b/libavcodec/dss_sp.c
index b337cb37ae..3187a76eec 100644
--- a/libavcodec/dss_sp.c
+++ b/libavcodec/dss_sp.c
@@ -33,7 +33,7 @@
#define DSS_SP_FRAME_SIZE 42
#define DSS_SP_SAMPLE_COUNT (66 * SUBFRAMES)
-#define DSS_SP_FORMULA(a, b, c) (((((a) * (1 << 15)) + (b) * (c)) + 0x4000) >> 15)
+#define DSS_SP_FORMULA(a, b, c) ((int)((((a) * (1 << 15)) + (b) * (unsigned)(c)) + 0x4000) >> 15)
typedef struct DssSpSubframe {
int16_t gain;
@@ -524,7 +524,7 @@ static void dss_sp_shift_sq_sub(const int32_t *filter_buf,
tmp = dst[a] * filter_buf[0];
for (i = 14; i > 0; i--)
- tmp -= error_buf[i] * filter_buf[i];
+ tmp -= error_buf[i] * (unsigned)filter_buf[i];
for (i = 14; i > 0; i--)
error_buf[i] = error_buf[i - 1];