aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-04 12:47:20 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-06 02:08:26 +0100
commitf41c1d3bfeca1b9dfbf2c3735f0f2f3ed6591632 (patch)
tree83a6fd6f67da7c8847f666afe70eff45e4cda27b
parentcfd1bc581099d403b4a70981f508252f3a2e3e31 (diff)
downloadffmpeg-f41c1d3bfeca1b9dfbf2c3735f0f2f3ed6591632.tar.gz
avcodec/vp3: Fix "runtime error: left shift of negative value"
Fixes: 5c6129154b356b80bcab86f9e3ee5d29/signal_sigabrt_7ffff6ae7cc9_7322_d26ac6d7cb6567db1b8be0159b387d0b.ogg Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 18268f761bffb37552f59f87542fef3d5c80618c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vp3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 869b6a5f7a..44291f205f 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -206,8 +206,8 @@ typedef struct Vp3DecodeContext {
int16_t *dct_tokens[3][64];
int16_t *dct_tokens_base;
#define TOKEN_EOB(eob_run) ((eob_run) << 2)
-#define TOKEN_ZERO_RUN(coeff, zero_run) (((coeff) << 9) + ((zero_run) << 2) + 1)
-#define TOKEN_COEFF(coeff) (((coeff) << 2) + 2)
+#define TOKEN_ZERO_RUN(coeff, zero_run) (((coeff) * 512) + ((zero_run) << 2) + 1)
+#define TOKEN_COEFF(coeff) (((coeff) * 4) + 2)
/**
* number of blocks that contain DCT coefficients at