aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-22 14:51:37 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-22 16:54:20 -0800
commit1254022ea717fba6f189d6a66841e0ba204ed80a (patch)
tree606c6f6ecdc76fefb7c9a78c50249cf35ce07786
parent562ebc30775db243941db3c96396e7bf8a0e0a44 (diff)
downloadffmpeg-1254022ea717fba6f189d6a66841e0ba204ed80a.tar.gz
swscale: fix filtersize clipping.
if srcW<=2, clip(x, 1, srcW-2) still allows srcW to be < 1.
-rw-r--r--libswscale/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2fe9c5b47f..6ae8af64e9 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);