diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-24 05:28:49 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-27 06:29:30 +0300 |
commit | 1bfc1aa004950c5ad527d823a08b8a19eef34eb0 (patch) | |
tree | d4cbc466b530530d08ca995725d405da8811e162 /libavcodec/mjpegdec.c | |
parent | c6939f65a116b1ffed345d29d8621ee4ffb32235 (diff) |
avcodec/mjpegdec: Fix integer overflow in DC dequantization
Fixes: runtime error: signed integer overflow: -65535 * 65312 cannot be represented in type 'int'
Fixes: 4900/clusterfuzz-testcase-minimized-5769019744321536
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 e005dd0cd3..5055ee2826 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -715,7 +715,7 @@ static int decode_block(MJpegDecodeContext *s, int16_t *block, int component, av_log(s->avctx, AV_LOG_ERROR, "error dc\n"); return AVERROR_INVALIDDATA; } - val = val * quant_matrix[0] + s->last_dc[component]; + val = val * (unsigned)quant_matrix[0] + s->last_dc[component]; val = av_clip_int16(val); s->last_dc[component] = val; block[0] = val; |