On 02/22/2012 05:51 PM, Ronald S. Bultje wrote: > From: "Ronald S. Bultje" <[email protected]> > > if srcW<=2, clip(x, 1, srcW-2) still allows srcW to be < 1. > --- > 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); >
lgtm. although it might also be nice to have an av_clip() alternative that allows min/max to be in either order. -Justin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
