[FFmpeg-cvslog] avcodec/wmalosslessdec: Fix integer overflow in mclms_predict()

Michael Niedermayer git at videolan.org
Tue Jul 7 21:40:22 EEST 2020


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sat May 23 22:02:56 2020 +0200| [b4c08bbd9c1dce47261e9c802df71968d6fb7505] | committer: Michael Niedermayer

avcodec/wmalosslessdec: Fix integer overflow in mclms_predict()

Fixes: signed integer overflow: 2147483636 + 2048 cannot be represented in type 'int'
Fixes: 22016/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5109395618004992

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 c42ed06695848617350a94543823e850f190b3ab)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 8eb473e3ba..78b9b5c1fd 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -679,7 +679,7 @@ static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
         for (i = 0; i < ich; i++)
             pred[ich] += (uint32_t)s->channel_residues[i][icoef] *
                          s->mclms_coeffs_cur[i + num_channels * ich];
-        pred[ich] += (1 << s->mclms_scaling) >> 1;
+        pred[ich] += (1U << s->mclms_scaling) >> 1;
         pred[ich] >>= s->mclms_scaling;
         s->channel_residues[ich][icoef] += (unsigned)pred[ich];
     }



More information about the ffmpeg-cvslog mailing list