avcodec/ac3dec: Fix shift signedness in mask creation
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Sep 2018 00:36:50 +0000 (02:36 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Sep 2018 22:12:27 +0000 (00:12 +0200)
Fixes: 9924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5473421772193792
Fixes: left shift of 1 by 63 places cannot be represented in type 'long long'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/ac3dec.c

index eed8ce5..43b22b7 100644 (file)
@@ -1708,9 +1708,9 @@ dependent_frame:
                     int i;
 
                     for (i = 0; i < 64; i++) {
-                        if ((1LL << i) & ff_eac3_custom_channel_map_locations[ch][1]) {
+                        if ((1ULL << i) & ff_eac3_custom_channel_map_locations[ch][1]) {
                             int index = av_get_channel_layout_channel_index(channel_layout,
-                                                                            1LL << i);
+                                                                            1ULL << i);
                             if (index < 0)
                                 return AVERROR_INVALIDDATA;
                             if (extend >= channel_map_size)