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>
This commit is contained in:
Andreas Rheinhardt 2019-09-28 04:26:02 +02:00 committed by Michael Niedermayer
parent f7bc0386d9
commit e2646e23be

View File

@ -390,7 +390,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
(*filterPos)[i] = xx; (*filterPos)[i] = xx;
// bilinear upscale / linear interpolate / area averaging // bilinear upscale / linear interpolate / area averaging
for (j = 0; j < filterSize; j++) { 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) if (coeff < 0)
coeff = 0; coeff = 0;
filter[i * filterSize + j] = coeff; filter[i * filterSize + j] = coeff;