aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-08 21:41:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 12:20:15 +0200
commit60385207aa366fec5142ce551ae71591c010cb1d (patch)
treec4d71124ef2e97c6c227e18267e9b24174af8803
parentd63cec6ce3b4ba6a4aa89232da3627238535cd55 (diff)
downloadffmpeg-60385207aa366fec5142ce551ae71591c010cb1d.tar.gz
avcodec/mjpegdec: Fix runtime error: left shift of negative value -127
Fixes: 733/clusterfuzz-testcase-4682158096515072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 800d02abe041deacab5585bf41c1bc2ae5f4b922) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mjpegdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7e1d716af3..090f269dc3 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1196,13 +1196,13 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
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
PREDICT(pred, ptr16[-linesize-1], ptr16[-linesize], ptr16[-1], predictor);
pred &= mask;
- *ptr16= pred + (dc << point_transform);
+ *ptr16= pred + ((unsigned)dc << point_transform);
}
if (++x == h) {