summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-05-02 00:21:23 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-05-03 18:25:17 +0200
commit3a177a9cca924e097265b32f9282814f6b653e08 (patch)
treec764e353dcdf587cbf9e24f55052777aa316864f /libswscale
parent925c37874b617816b6f460c6f229c18b46548b46 (diff)
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
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 6af41f8b30..fa00668c8e 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -331,7 +331,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
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++) {