aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-28 18:09:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 01:05:28 +0200
commita871e42e30c3a7fb0f503465fec6ae9a292c6f16 (patch)
tree210e465a111724b6383111babc5fbd25ec067ac4
parentb08f7e592f89de8d1a655170387f165ce92c5a69 (diff)
downloadffmpeg-a871e42e30c3a7fb0f503465fec6ae9a292c6f16.tar.gz
avcodec/aacdec_fixed: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 1878/clusterfuzz-testcase-minimized-6441918630199296 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 6b9cb5d26a2d9905093621d12785bc5903dce66d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aacdec_fixed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index b78a27a236..7945c46355 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -211,8 +211,8 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
for (i=0; i<len; i++) {
coefs[i] = 0;
}
- } else if (s > 0) {
- round = 1 << (s-1);
+ } else if (s >= 0) {
+ round = s ? 1 << (s-1) : 0;
for (i=0; i<len; i++) {
out = (int)(((int64_t)coefs[i] * c) >> 32);
coefs[i] = ((int)(out+round) >> s) * ssign;