History

swscale/utils: Fix for runtime error: left shift of negative value -1

Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Michael Niedermayer committed 10 years ago

Commit 325b5931 parent 4f241981 file · +1 −1Browse files

Unified · Split

libswscale/utils.c+1−1
@@ -386,7 +386,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, · 385 unmodified lines
386386
387387 xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
388388 for (i = 0; i < dstW; i++) {
389− int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
389+ int xx = (xDstInSrc - (filterSize - 2) * (1LL<<16)) / (1 << 17);
390390 int j;
391391 (*filterPos)[i] = xx;
392392 for (j = 0; j < filterSize; j++) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t