[FFmpeg-cvslog] avcodec/wmadec: Fix undefined shift in wma_decode_block()

Michael Niedermayer git at videolan.org
Sat Mar 14 17:33:09 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Mar 14 17:11:59 2015 +0100| [a48b24e5ebdb21d25512ac481a1d396e7685f0a4] | committer: Michael Niedermayer

avcodec/wmadec: Fix undefined shift in wma_decode_block()

Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu at google.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a48b24e5ebdb21d25512ac481a1d396e7685f0a4
---

 libavcodec/wmadec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index d80bd2b..ffbf511 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -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);



More information about the ffmpeg-cvslog mailing list