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

Michael Niedermayer git at videolan.org
Sun Dec 4 02:58:12 EET 2016


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

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

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 0c4ab43..65edac2 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