aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-10 19:09:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-16 16:00:23 +0200
commit41392c52499a47d61979c6880be51a4fe41306cb (patch)
treea197ba777e71e9db9551e88fdb63ef94eb9f3609
parente4def6e0b6085db85765d734b1044638d0e884ba (diff)
downloadffmpeg-41392c52499a47d61979c6880be51a4fe41306cb.tar.gz
avcodec/truemotion1: Fix multiple runtime error: left shift of negative value -1
Fixes: 1446/clusterfuzz-testcase-minimized-5577409124368384 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 db5fae32294763677caa4c1417dcba704c7e764e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/truemotion1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index da843c4440..08af622fa2 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -177,10 +177,10 @@ static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
int lo, hi;
lo = ydt[p1];
- lo += (lo << 5) + (lo << 10);
+ lo += (lo * 32) + (lo * 1024);
hi = ydt[p2];
- hi += (hi << 5) + (hi << 10);
- return (lo + (hi << 16)) << 1;
+ hi += (hi * 32) + (hi * 1024);
+ return (lo + (hi * (1 << 16))) * 2;
}
static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
@@ -188,9 +188,9 @@ static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
int r, b, lo;
b = cdt[p2];
- r = cdt[p1] << 10;
+ r = cdt[p1] * 1024;
lo = b + r;
- return (lo + (lo << 16)) << 1;
+ return (lo + (lo * (1 << 16))) * 2;
}
#if HAVE_BIGENDIAN