aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-21 02:51:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-18 16:05:22 +0200
commit87de89ac7856598cfb7bd3b74387c68defa517e6 (patch)
treee9c32053792976ed904c91a069e8c81e24ceb144
parent56ce2cae385e2de3b6f7618c28cb28ce7a87d012 (diff)
downloadffmpeg-87de89ac7856598cfb7bd3b74387c68defa517e6.tar.gz
avcodec/aac_defines: Fix: runtime error: left shift of negative value -2
Fixes: 1716/clusterfuzz-testcase-minimized-4691012196761600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c3547dcbc326474745f02a618e01848a293f3f92) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aac_defines.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h
index c12dc2fab7..0ea667e77b 100644
--- a/libavcodec/aac_defines.h
+++ b/libavcodec/aac_defines.h
@@ -45,7 +45,7 @@ typedef int AAC_SIGNE;
#define Q30(x) (int)((x)*1073741824.0 + 0.5)
#define Q31(x) (int)((x)*2147483648.0 + 0.5)
#define RANGE15(x) x
-#define GET_GAIN(x, y) (-(y) << (x)) + 1024
+#define GET_GAIN(x, y) (-(y) * (1 << (x))) + 1024
#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16)
#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26)
#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30)