swscale: fix ticket #4877
authorPedro Arthur <bygrandao@gmail.com>
Fri, 25 Sep 2015 15:17:43 +0000 (12:17 -0300)
committerPedro Arthur <bygrandao@gmail.com>
Fri, 25 Sep 2015 15:18:58 +0000 (12:18 -0300)
libswscale/swscale.c

index 346728d..2ccf38f 100644 (file)
@@ -480,17 +480,18 @@ static int swscale(SwsContext *c, const uint8_t *src[],
     ff_init_slice_from_src(vout_slice, (uint8_t**)dst, dstStride, c->dstW,
             dstY, dstH, dstY >> c->chrDstVSubSample,
             FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample));
     ff_init_slice_from_src(vout_slice, (uint8_t**)dst, dstStride, c->dstW,
             dstY, dstH, dstY >> c->chrDstVSubSample,
             FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample));
-
-    hout_slice->plane[0].sliceY = lastInLumBuf + 1;
-    hout_slice->plane[1].sliceY = lastInChrBuf + 1;
-    hout_slice->plane[2].sliceY = lastInChrBuf + 1;
-    hout_slice->plane[3].sliceY = lastInLumBuf + 1;
-
-    hout_slice->plane[0].sliceH =
-    hout_slice->plane[1].sliceH =
-    hout_slice->plane[2].sliceH =
-    hout_slice->plane[3].sliceH = 0;
-    hout_slice->width = dstW;
+    if (srcSliceY == 0) {
+        hout_slice->plane[0].sliceY = lastInLumBuf + 1;
+        hout_slice->plane[1].sliceY = lastInChrBuf + 1;
+        hout_slice->plane[2].sliceY = lastInChrBuf + 1;
+        hout_slice->plane[3].sliceY = lastInLumBuf + 1;
+
+        hout_slice->plane[0].sliceH =
+        hout_slice->plane[1].sliceH =
+        hout_slice->plane[2].sliceH =
+        hout_slice->plane[3].sliceH = 0;
+        hout_slice->width = dstW;
+    }
 #endif
 
     for (; dstY < dstH; dstY++) {
 #endif
 
     for (; dstY < dstH; dstY++) {