avcodec/mpeg12dec: Fix runtime error: left shift of negative value
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 19 Feb 2017 17:47:13 +0000 (18:47 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 19 Feb 2017 18:48:57 +0000 (19:48 +0100)
Fixes: 608/clusterfuzz-testcase-603978286392934

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

index f3cf6eb..5f86029 100644 (file)
@@ -865,8 +865,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
                                                    s->last_mv[i][0][1]);
                             /* full_pel: only for MPEG-1 */
                             if (s->full_pel[i]) {
-                                s->mv[i][0][0] <<= 1;
-                                s->mv[i][0][1] <<= 1;
+                                s->mv[i][0][0] *= 2;
+                                s->mv[i][0][1] *= 2;
                             }
                         }
                     }