for (y = beg; y != end; y += inc)
{
BYTE* pRGB = &pDstData[((nYDst + y) * nDstStep) + (nXDst * GetBytesPerPixel(
- DstFormat))];
+ DstFormat))];
if (!writeLine(&pRGB, DstFormat, nWidth, &pR, &pG, &pB, &pA))
return FALSE;
for (y = beg; y != end; y += inc)
{
BYTE* pRGB = &pDstData[((nYDst + y) * nDstStep) + (nXDst * GetBytesPerPixel(
- DstFormat))];
+ DstFormat))];
if (!writeLine(&pRGB, DstFormat, nWidth, &pR, &pG, &pB, &pA))
return FALSE;
return outPlane;
}
-static INLINE UINT32 freerdp_bitmap_planar_compress_planes_rle(
+static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle(
BYTE* inPlanes[4], UINT32 width, UINT32 height,
BYTE* outPlanes, UINT32* dstSizes, BOOL skipAlpha)
{
if (!freerdp_bitmap_planar_compress_plane_rle(
inPlanes[0], width, height, outPlanes, &dstSizes[0]))
- return 0;
+ return FALSE;
outPlanes += dstSizes[0];
outPlanesSize -= dstSizes[0];
if (!freerdp_bitmap_planar_compress_plane_rle(inPlanes[1], width, height,
outPlanes, &dstSizes[1]))
- return 0;
+ return FALSE;
outPlanes += dstSizes[1];
outPlanesSize -= dstSizes[1];
if (!freerdp_bitmap_planar_compress_plane_rle(inPlanes[2], width, height,
outPlanes, &dstSizes[2]))
- return 0;
+ return FALSE;
outPlanes += dstSizes[2];
outPlanesSize -= dstSizes[2];
if (!freerdp_bitmap_planar_compress_plane_rle(inPlanes[3], width, height,
outPlanes, &dstSizes[3]))
- return 0;
+ return FALSE;
- return 1;
+ return TRUE;
}
BYTE* freerdp_bitmap_planar_delta_encode_plane(const BYTE* inPlane,
context->deltaPlanes))
return NULL;
- if (freerdp_bitmap_planar_compress_planes_rle(
+ if (!freerdp_bitmap_planar_compress_planes_rle(
context->deltaPlanes, width, height,
context->rlePlanesBuffer, dstSizes,
- context->AllowSkipAlpha) > 0)
+ context->AllowSkipAlpha))
+ return NULL;
+
{
int offset = 0;
FormatHeader |= PLANAR_FORMAT_HEADER_RLE;
}
}
+ if (FormatHeader & PLANAR_FORMAT_HEADER_RLE)
+ {
+ if (!context->AllowRunLengthEncoding)
+ return NULL;
+
+ if (context->rlePlanes[0] == NULL)
+ return NULL;
+
+ if (context->rlePlanes[1] == NULL)
+ return NULL;
+
+ if (context->rlePlanes[2] == NULL)
+ return NULL;
+
+ if (context->rlePlanes[3] == NULL)
+ return NULL;
+ }
+
if (!dstData)
{
size = 1;