aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-03 04:39:05 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-16 16:00:22 +0200
commitce54743d828050c14cbe4ccc39e67de557b46731 (patch)
treec9710e112511d90334f2a30e59da5e355c4afe1d
parent67d84d2c48a61c6009fb4bcc08f0c196c6d6115e (diff)
downloadffmpeg-ce54743d828050c14cbe4ccc39e67de557b46731.tar.gz
avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13
Fixes: 709/clusterfuzz-testcase-4789836449841152 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 d757ddbaab8f03b3664788e620314b70ac791319) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mpeg12dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 3ae4d09a84..eb90af2143 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -497,7 +497,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
dc = s->last_dc[component];
dc += diff;
s->last_dc[component] = dc;
- block[0] = dc << (3 - s->intra_dc_precision);
+ block[0] = dc * (1 << (3 - s->intra_dc_precision));
ff_tlog(s->avctx, "dc=%d\n", block[0]);
mismatch = block[0] ^ 1;
i = 0;