diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-22 14:51:37 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-22 16:54:20 -0800 |
commit | 1254022ea717fba6f189d6a66841e0ba204ed80a (patch) | |
tree | 606c6f6ecdc76fefb7c9a78c50249cf35ce07786 /libswscale/utils.c | |
parent | 562ebc30775db243941db3c96396e7bf8a0e0a44 (diff) | |
download | ffmpeg-streaming-1254022ea717fba6f189d6a66841e0ba204ed80a.zip ffmpeg-streaming-1254022ea717fba6f189d6a66841e0ba204ed80a.tar.gz |
swscale: fix filtersize clipping.
if srcW<=2, clip(x, 1, srcW-2) still allows srcW to be < 1.
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 2fe9c5b..6ae8af6 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -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); |