[FFmpeg-cvslog] avcodec/wma: Fix undefined shift in ff_wma_run_level_decode()

Michael Niedermayer git at videolan.org
Wed Mar 11 15:36:56 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Mar 11 13:32:08 2015 +0100| [bd4c4c868c37c7495216422e17c8b9c8e8a74c4a] | committer: Michael Niedermayer

avcodec/wma: Fix undefined shift in ff_wma_run_level_decode()

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=bd4c4c868c37c7495216422e17c8b9c8e8a74c4a
---

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

diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index d8949d5..99a87f6 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -451,7 +451,7 @@ int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb,
             /** normal code */
             offset                  += run_table[code];
             sign                     = get_bits1(gb) - 1;
-            iptr[offset & coef_mask] = ilvl[code] ^ sign << 31;
+            iptr[offset & coef_mask] = ilvl[code] ^ (sign & 0x80000000);
         } else if (code == 1) {
             /** EOB */
             break;



More information about the ffmpeg-cvslog mailing list