diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-05 03:17:24 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-06 17:58:08 +0300 |
commit | 936f4a2c2e14ec753e8835f2e820b4cd9aec9a56 (patch) | |
tree | da0a6bfa29619da4a9ee5dec64eaf30889087b9e /libavcodec/mjpegdec.c | |
parent | 79c6047c3668c639f717b3a7001a34dddba0ede2 (diff) |
avcodec/mjpegdec: Fix integer overflow in ljpeg_decode_rgb_scan()
Fixes: signed integer overflow: 32768 + 2147450880 cannot be represented in type 'int'
Fixes: 7885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5298834394578944
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 22ca69f841..d1dca84d36 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1078,7 +1078,7 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p return -1; left[i] = buffer[mb_x][i] = - mask & (pred + (dc * (1 << point_transform))); + mask & (pred + (unsigned)(dc * (1 << point_transform))); } if (s->restart_interval && !--s->restart_count) { |