[FFmpeg-cvslog] swscale: fix filtersize clipping.

Ronald S. Bultje git at videolan.org
Fri Feb 24 04:34:56 CET 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Wed Feb 22 14:51:37 2012 -0800| [1254022ea717fba6f189d6a66841e0ba204ed80a] | committer: Ronald S. Bultje

swscale: fix filtersize clipping.

if srcW<=2, clip(x, 1, srcW-2) still allows srcW to be < 1.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1254022ea717fba6f189d6a66841e0ba204ed80a
---

 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);
 



More information about the ffmpeg-cvslog mailing list