[libav-stable] swscale: correctly pad destination buffer in rgb conversion

Kostya Shishkov git at libav.org
Mon Aug 4 20:07:56 CEST 2014


Module: libav
Branch: master
Commit: 5420099cab1e915b191cceccec4364f54cec6e52

Author:    Kostya Shishkov <kostya.shishkov at gmail.com>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Sun Aug  3 10:28:49 2014 +0100

swscale: correctly pad destination buffer in rgb conversion

Bug-Id: 772
CC: libav-stable at libav.org
Found-By: Justin Ruggles <justin.ruggles at gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>

---

 libswscale/swscale_unscaled.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 02850ea..a1ccc5a 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -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,
-                 srcSliceH * srcStride[0]);
+                 (srcSliceH - 1) * srcStride[0] + c->srcW * srcBpp);
         else {
             int i;
             dstPtr += dstStride[0] * srcSliceY;



More information about the libav-stable mailing list