]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 17 Dec 2019 23:07:50 +0000 (00:07 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 2 Feb 2020 23:11:18 +0000 (00:11 +0100)
Fixes: left shift of 32 by 28 places cannot be represented in type 'int'
Fixes: 19472/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PCM_LXF_fuzzer-5704364320096256
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pcm.c

index 4ce0b9487bb38803dca330d3128de973968ae23a..0c4b452b0e1ef111b6656ebe40dae4b4b01c005b 100644 (file)
@@ -515,7 +515,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
             dst_int32_t = (int32_t *)frame->extended_data[c];
             for (i = 0; i < n; i++) {
                 // extract low 20 bits and expand to 32 bits
-                *dst_int32_t++ =  (src[2]         << 28) |
+                *dst_int32_t++ =  ((uint32_t)src[2]<<28) |
                                   (src[1]         << 20) |
                                   (src[0]         << 12) |
                                  ((src[2] & 0x0F) <<  8) |