avcodec/wmadec: Fix undefined shift in wma_decode_block()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Mar 2015 16:11:59 +0000 (17:11 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Mar 2015 16:32:12 +0000 (17:32 +0100)
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wmadec.c

index d80bd2b..ffbf511 100644 (file)
@@ -697,7 +697,7 @@ static int wma_decode_block(WMACodecContext *s)
 
                 /* very high freqs : noise */
                 n     = s->block_len - s->coefs_end[bsize];
-                mult1 = mult * exponents[((-1 << bsize)) >> esize];
+                mult1 = mult * exponents[(-(1 << bsize)) >> esize];
                 for (i = 0; i < n; i++) {
                     *coefs++       = s->noise_table[s->noise_index] * mult1;
                     s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);