[FFmpeg-cvslog] avcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF

Michael Niedermayer git at videolan.org
Fri Apr 24 02:13:34 EEST 2020


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Dec 18 00:07:50 2019 +0100| [bfdc0b24a91138b8d80c3ea8c0cf7133d864b83d] | committer: Michael Niedermayer

avcodec/pcm: Fix invalid shift in pcm_decode_frame for LXF

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 at niedermayer.cc>
(cherry picked from commit 985d3666f672781152f4b68093740ea6a9888194)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 2cb5a360d6..929edcb1c5 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -467,7 +467,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) |



More information about the ffmpeg-cvslog mailing list