[FFmpeg-cvslog] avcodec/flacdec: Fix undefined shift in decode_subframe()

Michael Niedermayer git at videolan.org
Tue Dec 6 01:27:33 EET 2016


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Dec  4 00:11:17 2016 +0100| [af1e19b9e4d66f7d5070cf6b3a9b7288374ddee5] | committer: Michael Niedermayer

avcodec/flacdec: Fix undefined shift in decode_subframe()

Fixes undefined behavior
Fixes: 639961-media

Found-by: Matt Wolenetz <wolenetz at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1f5630af51f24d79053b6bef5b8b3ba93d637306)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 5f5802c..4dde0e0 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -448,7 +448,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
     if (wasted) {
         int i;
         for (i = 0; i < s->blocksize; i++)
-            decoded[i] <<= wasted;
+            decoded[i] = (unsigned)decoded[i] << wasted;
     }
 
     return 0;



More information about the ffmpeg-cvslog mailing list