summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-28 04:26:02 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 14:13:49 +0200
commit94d7fbe373881c9d409e256c2986f3e055d6357d (patch)
tree4a407318b6b9c0cd68bc38d67d0cf9a66d834656
parent2c5943a3848195a25354a0d09338854431e519b9 (diff)
downloadffmpeg-94d7fbe373881c9d409e256c2986f3e055d6357d.tar.gz
swscale/utils: Fix invalid left shifts of negative numbers
Affected the FATE-tests vsynth_lena-dv-411, vsynth1-dv-411, vsynth2-dv-411 and hevc-paramchange-yuv420p.yuv420p10. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit e2646e23be69bdef1e41d4decee1a4298701b8d1) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libswscale/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 4c9b53bbeb..19fb284931 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -378,7 +378,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
(*filterPos)[i] = xx;
// bilinear upscale / linear interpolate / area averaging
for (j = 0; j < filterSize; j++) {
- int64_t coeff= fone - FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16);
+ int64_t coeff = fone - FFABS((int64_t)xx * (1 << 16) - xDstInSrc) * (fone >> 16);
if (coeff < 0)
coeff = 0;
filter[i * filterSize + j] = coeff;