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

Michael Niedermayer git at videolan.org
Sun Feb 19 22:51:08 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Feb 19 20:39:13 2017 +0100| [c91bdd4524815125e1f7d8dee22ee7a73173c39a] | committer: Michael Niedermayer

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

Fixes: 611/clusterfuzz-testcase-5613455820193792

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=c91bdd4524815125e1f7d8dee22ee7a73173c39a
---

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 34a988d..69469c5 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1137,7 +1137,7 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
                         if (s->interlaced && s->bottom_field)
                             ptr += linesize >> 1;
                         pred &= mask;
-                        *ptr= pred + (dc << point_transform);
+                        *ptr= pred + ((unsigned)dc << point_transform);
                         }else{
                             ptr16 = (uint16_t*)(s->picture_ptr->data[c] + 2*(linesize * (v * mb_y + y)) + 2*(h * mb_x + x)); //FIXME optimize this crap
                             if(y==0 && toprow){



More information about the ffmpeg-cvslog mailing list