Fix #5061: Initialize output buffer transparent.
authorArmin Novak <armin.novak@thincast.com>
Fri, 23 Nov 2018 08:16:23 +0000 (09:16 +0100)
committerArmin Novak <armin.novak@thincast.com>
Fri, 23 Nov 2018 09:57:17 +0000 (10:57 +0100)
libfreerdp/codec/color.c

index ed00646..477c0ef 100644 (file)
@@ -179,6 +179,12 @@ BOOL freerdp_image_copy_from_pointer_data(
        if (nDstStep <= 0)
                nDstStep = dstBytesPerPixel * nWidth;
 
+       for (y = nYDst; y < nHeight; y++)
+       {
+               BYTE* pDstLine = &pDstData[y * nDstStep + nXDst * dstBytesPerPixel];
+               memset(pDstLine, 0, dstBytesPerPixel * (nWidth - nXDst));
+       }
+
        vFlip = (xorBpp == 1) ? FALSE : TRUE;
        andStep = (nWidth + 7) / 8;
        andStep += (andStep % 2);