mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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
This commit is contained in:
parent
925c37874b
commit
3a177a9cca
@ -331,7 +331,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
|
|||||||
|
|
||||||
xDstInSrc = xInc - 0x10000;
|
xDstInSrc = xInc - 0x10000;
|
||||||
for (i = 0; i < dstW; i++) {
|
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;
|
int j;
|
||||||
(*filterPos)[i] = xx;
|
(*filterPos)[i] = xx;
|
||||||
for (j = 0; j < filterSize; j++) {
|
for (j = 0; j < filterSize; j++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user