]> git.sesse.net Git - ffmpeg/commitdiff
avformat/wsddec: Fix undefined shift
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 8 Jun 2019 07:27:49 +0000 (09:27 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Jun 2019 16:28:00 +0000 (18:28 +0200)
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@niedermayer.cc>
libavformat/wsddec.c

index dfa8014b1c6a7dd0d2f355c4c815b522dfdc2cff..574addf620733546a938a7cb8a058d9954860b27 100644 (file)
@@ -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);
     }