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>
This commit is contained in:
Michael Niedermayer 2017-05-28 18:09:47 +02:00
parent 67b30decf7
commit 6b9cb5d26a
1 changed files with 2 additions and 2 deletions

View File

@ -211,8 +211,8 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
coefs[i] = 0; coefs[i] = 0;
} }
} else if (s > 0) { } else if (s >= 0) {
round = 1 << (s-1); round = s ? 1 << (s-1) : 0;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
out = (int)(((int64_t)coefs[i] * c) >> 32); out = (int)(((int64_t)coefs[i] * c) >> 32);
coefs[i] = ((int)(out+round) >> s) * ssign; coefs[i] = ((int)(out+round) >> s) * ssign;