avcodec/mjpegdec: Fix runtime error: signed integer overflow: -24543 * 2031616 cannot be represented in type 'int'

Fixes: 943/clusterfuzz-testcase-5114865297391616

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 a78ae465fda902565ed041d93403e04490b4be0d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-04-27 15:10:25 +02:00
parent 3755414d01
commit 133705f9e8

View File

@ -698,7 +698,8 @@ static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block,
int16_t *quant_matrix,
int ss, int se, int Al, int *EOBRUN)
{
int code, i, j, level, val, run;
int code, i, j, val, run;
unsigned level;
if (*EOBRUN) {
(*EOBRUN)--;