#define TAG FREERDP_TAG("codec")
-static INLINE BYTE* freerdp_bitmap_planar_compress_plane_rle(
+static INLINE BOOL freerdp_bitmap_planar_compress_plane_rle(
const BYTE* plane, UINT32 width, UINT32 height,
BYTE* outPlane, UINT32* dstSize);
static INLINE BYTE* freerdp_bitmap_planar_delta_encode_plane(
return nTotalBytesWritten;
}
-BYTE* freerdp_bitmap_planar_compress_plane_rle(const BYTE* inPlane,
+BOOL freerdp_bitmap_planar_compress_plane_rle(const BYTE* inPlane,
UINT32 width, UINT32 height,
BYTE* outPlane, UINT32* dstSize)
{
UINT32 nTotalBytesWritten;
if (!outPlane)
- {
- outBufferSize = width * height;
-
- if (outBufferSize == 0)
- return NULL;
-
- outPlane = malloc(outBufferSize);
-
- if (!outPlane)
- return NULL;
- }
- else
- {
- outBufferSize = *dstSize;
- }
+ return FALSE;
index = 0;
pInput = inPlane;
pOutput = outPlane;
+ outBufferSize = *dstSize;
nTotalBytesWritten = 0;
while (outBufferSize)
pInput, width, pOutput, outBufferSize);
if ((!nBytesWritten) || (nBytesWritten > outBufferSize))
- return NULL;
+ return FALSE;
outBufferSize -= nBytesWritten;
nTotalBytesWritten += nBytesWritten;
}
*dstSize = nTotalBytesWritten;
- return outPlane;
+ return TRUE;
}
static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle(