@@ -1020,7 +1020,7 @@ static int scale_internal(SwsContext *c,
int offset = srcSliceY_internal;
int slice_h = srcSliceH;
- // for dst slice scaling, offset the src pointers to match the dst slice
+ // for dst slice scaling, offset the pointers to match the unscaled API
if (scale_dst) {
av_assert0(offset == 0);
for (i = 0; i < 4 && src2[i]; i++) {
@@ -1028,7 +1028,13 @@ static int scale_internal(SwsContext *c,
break;
src2[i] += (dstSliceY >> ((i == 1 || i == 2) ? c->chrSrcVSubSample : 0)) * srcStride2[i];
}
- offset = 0;
+
+ for (i = 0; i < 4 && dst2[i]; i++) {
+ if (!dst2[i] || (i > 0 && usePal(c->dstFormat)))
+ break;
+ dst2[i] -= (dstSliceY >> ((i == 1 || i == 2) ? c->chrDstVSubSample : 0)) * dstStride2[i];
+ }
+ offset = dstSliceY;
slice_h = dstSliceH;
}
Fixes: alphablend=checkerboard Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libswscale/swscale.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)