# HG changeset patch # User michael # Date 1267825167 0 # Node ID ee9be9626e70654d107c9bb94438647cfabc6c57 # Parent 6ea2911ebebf4e247cc74006cbe68a14630d16f8 try to avoid returning odd slices. diff -r 6ea2911ebebf -r ee9be9626e70 libswscale/swscale_template.c --- a/libswscale/swscale_template.c Fri Mar 05 20:15:16 2010 +0000 +++ b/libswscale/swscale_template.c Fri Mar 05 21:39:27 2010 +0000 @@ -2651,8 +2651,10 @@ unsigned char *aDest=(CONFIG_SWSCALE_ALPHA && alpPixBuf) ? dst[3]+dstStride[3]*dstY : NULL; const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input + const int firstLumSrcY2= vLumFilterPos[FFMIN(dstY | ((1<chrDstVSubSample) - 1), dstH-1)]; const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input int lastLumSrcY= firstLumSrcY + vLumFilterSize -1; // Last line needed as input + int lastLumSrcY2=firstLumSrcY2+ vLumFilterSize -1; // Last line needed as input int lastChrSrcY= firstChrSrcY + vChrFilterSize -1; // Last line needed as input int enough_lines; @@ -2669,7 +2671,8 @@ firstChrSrcY, lastChrSrcY, lastInChrBuf); // Do we have enough lines in this slice to output the dstY line - enough_lines = lastLumSrcY < srcSliceY + srcSliceH && lastChrSrcY < -((-srcSliceY - srcSliceH)>>c->chrSrcVSubSample); + enough_lines = lastLumSrcY2 < srcSliceY + srcSliceH && lastChrSrcY < -((-srcSliceY - srcSliceH)>>c->chrSrcVSubSample); + if (!enough_lines) { lastLumSrcY = srcSliceY + srcSliceH - 1; lastChrSrcY = chrSrcSliceY + chrSrcSliceH - 1;