Merge commit '5420099cab1e915b191cceccec4364f54cec6e52'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Aug 2014 19:18:13 +0000 (21:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Aug 2014 19:18:17 +0000 (21:18 +0200)
* commit '5420099cab1e915b191cceccec4364f54cec6e52':
  swscale: correctly pad destination buffer in rgb conversion

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libswscale/swscale_unscaled.c

@@@ -1273,20 -671,15 +1273,20 @@@ static int rgbToRgbWrapper(SwsContext *
              srcPtr += ALT32_CORR;
  
          if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) &&
 -            !isRGBA32(srcFormat))
 +            !isRGBA32(srcFormat)) {
 +            int i;
 +            av_assert0(ALT32_CORR == 1);
 +            for (i = 0; i < srcSliceH; i++)
 +                dstPtr[dstStride[0] * (srcSliceY + i)] = 255;
              dstPtr += ALT32_CORR;
 +        }
  
          if (dstStride[0] * srcBpp == srcStride[0] * dstBpp && srcStride[0] > 0 &&
 -            !(srcStride[0] % srcBpp))
 +            !(srcStride[0] % srcBpp) && !dst_bswap && !src_bswap)
              conv(srcPtr, dstPtr + dstStride[0] * srcSliceY,
-                  srcSliceH * srcStride[0]);
+                  (srcSliceH - 1) * srcStride[0] + c->srcW * srcBpp);
          else {
 -            int i;
 +            int i, j;
              dstPtr += dstStride[0] * srcSliceY;
  
              for (i = 0; i < srcSliceH; i++) {