aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-05-02 00:21:23 +0200
committerReinhard Tartler <siretart@tauware.de>2014-05-31 20:07:52 -0400
commit7fa72700298107fe756311ecb4dee5270ff12d35 (patch)
tree803164cf511f53b483a7c7bbcab5996fa3043b34
parent65c3593792a9702d9e4135bba46b1ca186afed6c (diff)
downloadffmpeg-7fa72700298107fe756311ecb4dee5270ff12d35.tar.gz
swscale: Fix an undefined behaviour
Prevent a division by zero down the codepath. Sample-Id: 00001721-google Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
-rw-r--r--libswscale/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index f3a501230f..b4a7485569 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -269,7 +269,7 @@ static int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSi
xDstInSrc= xInc - 0x10000;
for (i=0; i<dstW; i++) {
- int xx= (xDstInSrc - ((filterSize-2)<<16)) / (1<<17);
+ int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
int j;
(*filterPos)[i]= xx;
for (j=0; j<filterSize; j++) {