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

Michael Niedermayer git at videolan.org
Fri Mar 3 02:03:57 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Mar  1 16:32:09 2017 +0100| [4b72d5cd6f9341dcafdbc1b9030166aa987b8304] | committer: Michael Niedermayer

avcodec/mjpegdec: Fix runtime error: left shift of negative value -511

Fixes: 693/clusterfuzz-testcase-6109776066904064

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=4b72d5cd6f9341dcafdbc1b9030166aa987b8304
---

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 69469c5..2b5adfc 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1157,7 +1157,7 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
                             if (s->interlaced && s->bottom_field)
                                 ptr16 += linesize >> 1;
                             pred &= mask;
-                            *ptr16= pred + (dc << point_transform);
+                            *ptr16= pred + ((unsigned)dc << point_transform);
                         }
                         if (++x == h) {
                             x = 0;



More information about the ffmpeg-cvslog mailing list