diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-21 16:53:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-21 20:47:26 +0200 |
commit | 96f0b1de49592044eee5ca2c549ecb81b31d3a3f (patch) | |
tree | ededf744dc95d7af6cc1d0734f484e77e4ec0e0c | |
parent | 0e003452c040b5b35f1aa33f4596540efa47f2a3 (diff) | |
download | ffmpeg-96f0b1de49592044eee5ca2c549ecb81b31d3a3f.tar.gz |
avcodec/aacdec_fixed: Fix runtime error: shift exponent 34 is too large for 32-bit type 'int'
Fixes: 1721/clusterfuzz-testcase-minimized-4719352135811072
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 b5228e44c7f3a5eba537c8a39a45cfbf2961a28d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/aacdec_fixed.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index bbb120f6fe..3c628b3e25 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -207,7 +207,11 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len) c /= band_energy; s = 21 + nlz - (s >> 2); - if (s > 0) { + if (s > 31) { + for (i=0; i<len; i++) { + coefs[i] = 0; + } + } else if (s > 0) { round = 1 << (s-1); for (i=0; i<len; i++) { out = (int)(((int64_t)coefs[i] * c) >> 32); |