projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
925c378
)
swscale: Fix an undefined behaviour
author
Luca Barbato
<lu_zero@gentoo.org>
Thu, 1 May 2014 22:21:23 +0000
(
00:21
+0200)
committer
Luca Barbato
<lu_zero@gentoo.org>
Sat, 3 May 2014 16:25:17 +0000
(18:25 +0200)
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
libswscale/utils.c
patch
|
blob
|
history
diff --git
a/libswscale/utils.c
b/libswscale/utils.c
index
6af41f8
..
fa00668
100644
(file)
--- 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++) {