Commit 41392c52 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit db5fae32)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e4def6e0
...@@ -177,10 +177,10 @@ static int make_ydt15_entry(int p1, int p2, int16_t *ydt) ...@@ -177,10 +177,10 @@ static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
int lo, hi; int lo, hi;
lo = ydt[p1]; lo = ydt[p1];
lo += (lo << 5) + (lo << 10); lo += (lo * 32) + (lo * 1024);
hi = ydt[p2]; hi = ydt[p2];
hi += (hi << 5) + (hi << 10); hi += (hi * 32) + (hi * 1024);
return (lo + (hi << 16)) << 1; return (lo + (hi * (1 << 16))) * 2;
} }
static int make_cdt15_entry(int p1, int p2, int16_t *cdt) 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) ...@@ -188,9 +188,9 @@ static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
int r, b, lo; int r, b, lo;
b = cdt[p2]; b = cdt[p2];
r = cdt[p1] << 10; r = cdt[p1] * 1024;
lo = b + r; lo = b + r;
return (lo + (lo << 16)) << 1; return (lo + (lo * (1 << 16))) * 2;
} }
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment