[FFmpeg-cvslog] avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13

Michael Niedermayer git at videolan.org
Sat Mar 4 19:07:40 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Mar  3 04:39:05 2017 +0100| [d757ddbaab8f03b3664788e620314b70ac791319] | committer: Michael Niedermayer

avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13

Fixes: 709/clusterfuzz-testcase-4789836449841152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index d44ddb2..27db14c 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -497,7 +497,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
     dc  = s->last_dc[component];
     dc += diff;
     s->last_dc[component] = dc;
-    block[0] = dc << (3 - s->intra_dc_precision);
+    block[0] = dc * (1 << (3 - s->intra_dc_precision));
     ff_tlog(s->avctx, "dc=%d\n", block[0]);
     mismatch = block[0] ^ 1;
     i = 0;



More information about the ffmpeg-cvslog mailing list