aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dss_sp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-05 18:07:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 00:21:49 +0200
commit5520e00a49af47f9d6cda78a579f6447cb3b1ba0 (patch)
treeac2690ab324c3791635beccaa31e180f16b38555 /libavcodec/dss_sp.c
parent671530ccb4382c0c2dcb914b7d3bfb1643058c41 (diff)
downloadffmpeg-5520e00a49af47f9d6cda78a579f6447cb3b1ba0.tar.gz
avcodec/dss_sp: Fix multiple left shift of negative value -466
Fixes: 1339/clusterfuzz-testcase-minimized-4614671485108224 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 38152d9368beb080b4acd6cd9e5ccc89b3f733bf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dss_sp.c')
-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 ddea48304f..93e54c5209 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) << 15) + (b) * (c)) + 0x4000) >> 15)
+#define DSS_SP_FORMULA(a, b, c) (((((a) * (1 << 15)) + (b) * (c)) + 0x4000) >> 15)
typedef struct DssSpSubframe {
int16_t gain;
@@ -499,7 +499,7 @@ static void dss_sp_scale_vector(int32_t *vec, int bits, int size)
vec[i] = vec[i] >> -bits;
else
for (i = 0; i < size; i++)
- vec[i] = vec[i] << bits;
+ vec[i] = vec[i] * (1 << bits);
}
static void dss_sp_update_buf(int32_t *hist, int32_t *vector)