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

Michael Niedermayer git at videolan.org
Sun Dec 4 22:13:03 EET 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Sun Dec  4 00:11:17 2016 +0100| [2c6792b0c68375a87aa1b6731b411d548bc1af05] | 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=2c6792b0c68375a87aa1b6731b411d548bc1af05
---

 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