swscale/utils: Fix undefined shift in initFilter()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Mar 2015 14:40:28 +0000 (15:40 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Mar 2015 14:40:28 +0000 (15:40 +0100)
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/utils.c

index df8d0a9..fd0247d 100644 (file)
@@ -384,7 +384,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
             int j;
             (*filterPos)[i] = xx;
             for (j = 0; j < filterSize; j++) {
-                int64_t d = (FFABS(((int64_t)xx << 17) - xDstInSrc)) << 13;
+                int64_t d = (FFABS(((int64_t)xx * (1 << 17)) - xDstInSrc)) << 13;
                 double floatd;
                 int64_t coeff;