From 14ed7743ed0b94db7f640bdd81d56e97b802e24a Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 4 Oct 2016 09:00:00 +0200 Subject: [PATCH] Reformatted file. --- client/Windows/wf_graphics.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/client/Windows/wf_graphics.c b/client/Windows/wf_graphics.c index aa6fcc5f8..0d4c58499 100644 --- a/client/Windows/wf_graphics.c +++ b/client/Windows/wf_graphics.c @@ -212,6 +212,7 @@ static BOOL wf_Pointer_New(rdpContext* context, const rdpPointer* pointer) { BYTE* pdata = (BYTE*) _aligned_malloc(pointer->lengthAndMask + pointer->lengthXorMask, 16); + if (!pdata) goto fail; @@ -225,6 +226,7 @@ static BOOL wf_Pointer_New(rdpContext* context, const rdpPointer* pointer) else { BYTE* pdata = (BYTE*) _aligned_malloc(pointer->lengthAndMask, 16); + if (!pdata) goto fail; @@ -232,28 +234,31 @@ static BOOL wf_Pointer_New(rdpContext* context, const rdpPointer* pointer) pointer->height); info.hbmMask = CreateBitmap(pointer->width, pointer->height, 1, 1, pdata); _aligned_free(pdata); - pdata = (BYTE*) _aligned_malloc(pointer->width * pointer->height * GetBitsPerPixel(gdi->dstFormat), 16); + pdata = (BYTE*) _aligned_malloc(pointer->width * pointer->height * + GetBitsPerPixel(gdi->dstFormat), 16); + if (!pdata) goto fail; - if (!freerdp_image_copy_from_pointer_data(pdata, gdi->dstFormat, 0, 0, 0, pointer->width, pointer->height, - pointer->xorMaskData, pointer->lengthXorMask, - pointer->andMaskData, pointer->lengthAndMask, pointer->xorBpp, &gdi->palette)) + if (!freerdp_image_copy_from_pointer_data(pdata, gdi->dstFormat, 0, 0, 0, + pointer->width, pointer->height, + pointer->xorMaskData, pointer->lengthXorMask, + pointer->andMaskData, pointer->lengthAndMask, pointer->xorBpp, &gdi->palette)) { _aligned_free(pdata); goto fail; } + info.hbmColor = CreateBitmap(pointer->width, pointer->height, 1, - GetBitsPerPixel(gdi->dstFormat), pdata); + GetBitsPerPixel(gdi->dstFormat), pdata); _aligned_free(pdata); } hCur = CreateIconIndirect(&info); ((wfPointer*) pointer)->cursor = hCur; - rc = TRUE; - fail: + if (info.hbmMask) DeleteObject(info.hbmMask);