swscale: correctly pad destination buffer in rgb conversion
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 3 Aug 2014 09:28:49 +0000 (10:28 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 4 Aug 2014 11:55:07 +0000 (12:55 +0100)
Bug-Id: 772
CC: libav-stable@libav.org
Found-By: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libswscale/swscale_unscaled.c

index 02850ea..a1ccc5a 100644 (file)
@@ -677,7 +677,7 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
         if (dstStride[0] * srcBpp == srcStride[0] * dstBpp && srcStride[0] > 0 &&
             !(srcStride[0] % srcBpp))
             conv(srcPtr, dstPtr + dstStride[0] * srcSliceY,
         if (dstStride[0] * srcBpp == srcStride[0] * dstBpp && srcStride[0] > 0 &&
             !(srcStride[0] % srcBpp))
             conv(srcPtr, dstPtr + dstStride[0] * srcSliceY,
-                 srcSliceH * srcStride[0]);
+                 (srcSliceH - 1) * srcStride[0] + c->srcW * srcBpp);
         else {
             int i;
             dstPtr += dstStride[0] * srcSliceY;
         else {
             int i;
             dstPtr += dstStride[0] * srcSliceY;