[FFmpeg-cvslog] avcodec/mpc8: Fix 32bit mask/enum

Michael Niedermayer git at videolan.org
Wed Sep 4 22:25:52 EEST 2019


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sat Aug 10 23:09:42 2019 +0200| [4eef201e151ba54310d3fbf8e5d14c70dcc91238] | committer: Michael Niedermayer

avcodec/mpc8: Fix 32bit mask/enum

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 15817/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC8_fuzzer-5636626409062400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e8bb949ade4078ca318a9b3475cb7a6cfc7e4639)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index d7baac2f04..03838a9351 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -62,7 +62,7 @@ static inline int mpc8_dec_enum(GetBitContext *gb, int k, int n)
     do {
         n--;
         if (code >= C[n]) {
-            bits |= 1 << n;
+            bits |= 1U << n;
             code -= C[n];
             C -= 32;
             k--;



More information about the ffmpeg-cvslog mailing list