aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-04 21:44:05 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-06 02:51:27 +0100
commitaf4454561338dd9bccf83c9e96e4c48de4dc0119 (patch)
tree577774a7be9da81b1da3c512d3ceb23f40eddf8d
parent10fc3d690c8b6c326e3fb11694e17519e4226722 (diff)
downloadffmpeg-af4454561338dd9bccf83c9e96e4c48de4dc0119.tar.gz
swscale/utils: Fix for runtime error: left shift of negative value -1
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 325b59368dae3c3f2f5cc39873002b4cf133ccbc) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libswscale/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 0c4b4d7977..2a88dc96f7 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -385,7 +385,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
for (i = 0; i < dstW; i++) {
- int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
+ int xx = (xDstInSrc - (filterSize - 2) * (1LL<<16)) / (1 << 17);
int j;
(*filterPos)[i] = xx;
for (j = 0; j < filterSize; j++) {