[FFmpeg-cvslog] avformat/wsddec: Fix undefined shift

Michael Niedermayer git at videolan.org
Thu Jun 27 20:49:12 EEST 2019


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun  8 09:27:49 2019 +0200| [0789b6295bbf343ef07bb6629ff19aaf1de49ed7] | committer: Michael Niedermayer

avformat/wsddec: Fix undefined shift

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 15123/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5738039235575808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 112eb17a2bbf6d02f81fdf0743b353a6b010aedc)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/wsddec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/wsddec.c b/libavformat/wsddec.c
index 81a4dcc71e..a6bddec138 100644
--- a/libavformat/wsddec.c
+++ b/libavformat/wsddec.c
@@ -137,7 +137,7 @@ static int wsd_read_header(AVFormatContext *s)
     if (!(channel_assign & 1)) {
         int i;
         for (i = 1; i < 32; i++)
-            if (channel_assign & (1 << i))
+            if ((channel_assign >> i) & 1)
                 st->codecpar->channel_layout |= wsd_to_av_channel_layoyt(s, i);
     }
 



More information about the ffmpeg-cvslog mailing list