diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-05-02 00:21:23 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-05-08 19:56:00 -0400 |
commit | a56a9e65c6a17dd8b6303dd45bdc3e3368093092 (patch) | |
tree | 005c59c27ca69192f7acf5684eb3cb1dff8c5c78 | |
parent | 428b629eb28907738ae98331b9f6c25cc9a8f3c8 (diff) | |
download | ffmpeg-a56a9e65c6a17dd8b6303dd45bdc3e3368093092.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
(cherry picked from commit 3a177a9cca924e097265b32f9282814f6b653e08)
-rw-r--r-- | libswscale/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 2111fc2a62..ea5f36833e 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -326,7 +326,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++) { |