mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01:00
swscale: fix filtersize clipping.
if srcW<=2, clip(x, 1, srcW-2) still allows srcW to be < 1.
This commit is contained in:
parent
562ebc3077
commit
1254022ea7
1 changed files with 2 additions and 1 deletions
|
|
@ -263,7 +263,8 @@ static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSi
|
|||
if (xInc <= 1<<16) filterSize= 1 + sizeFactor; // upscale
|
||||
else filterSize= 1 + (sizeFactor*srcW + dstW - 1)/ dstW;
|
||||
|
||||
filterSize = av_clip(filterSize, 1, srcW - 2);
|
||||
filterSize = FFMIN(filterSize, srcW - 2);
|
||||
filterSize = FFMAX(filterSize, 1);
|
||||
|
||||
FF_ALLOC_OR_GOTO(NULL, filter, dstW*sizeof(*filter)*filterSize, fail);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue