diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-05-02 00:21:23 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-05-04 10:20:48 -0400 |
commit | 9a2387cfb1a99e4b00593c22074929cdc73410f0 (patch) | |
tree | 8936e3306ce25870cd97ae2c43a880e39544fc02 /libswscale/utils.c | |
parent | 696a74e81560889ef2fde76b045c5158a325a7a5 (diff) | |
download | ffmpeg-9a2387cfb1a99e4b00593c22074929cdc73410f0.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)
(cherry picked from commit 0499f7809c1fcc33ed710cdf771a18b374702135)
Diffstat (limited to 'libswscale/utils.c')
-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 f0a2b464fc..23eb4a48a1 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -316,7 +316,7 @@ static 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++) { |