avcodec/mjpegdec: Fix runtime error: signed integer overflow: -32767 * 130560 cannot...
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 21 May 2017 19:49:54 +0000 (21:49 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 22 May 2017 00:16:39 +0000 (02:16 +0200)
Fixes: 1724/clusterfuzz-testcase-minimized-4842395432648704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mjpegdec.c

index ed381de..5cdb489 100644 (file)
@@ -757,7 +757,7 @@ static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,
                                  int component, int dc_index,
                                  uint16_t *quant_matrix, int Al)
 {
-    int val;
+    unsigned val;
     s->bdsp.clear_block(block);
     val = mjpeg_decode_dc(s, dc_index);
     if (val == 0xfffff) {