avcodec/mjpegdec: Fix runtime error: signed integer overflow: -24543 * 2031616 cannot...
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 27 Apr 2017 13:10:25 +0000 (15:10 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 4 May 2017 18:42:54 +0000 (20:42 +0200)
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>
libavcodec/mjpegdec.c

index a86f6b2..ed381de 100644 (file)
@@ -776,7 +776,8 @@ static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block,
                                     uint16_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)--;