From: Armin Novak Date: Mon, 24 Sep 2018 07:38:01 +0000 (+0200) Subject: Fix NULL function pointer BeginPaint X-Git-Tag: 2.0.0-rc4~74^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d77875a69b56f103eff1452d891b677144f6aac;p=platform%2Fupstream%2Ffreerdp.git Fix NULL function pointer BeginPaint --- diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index a5e427f..f15c53a 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -94,6 +94,7 @@ static UINT gdi_ResetGraphics(RdpgfxClientContext* context, static UINT gdi_OutputUpdate(rdpGdi* gdi, gdiGfxSurface* surface) { + UINT rc = ERROR_INTERNAL_ERROR; UINT32 nXDst, nYDst; UINT32 nXSrc, nYSrc; UINT16 width, height; @@ -118,7 +119,8 @@ static UINT gdi_OutputUpdate(rdpGdi* gdi, gdiGfxSurface* surface) if (!(rects = region16_rects(&surface->invalidRegion, &nbRects)) || !nbRects) return CHANNEL_RC_OK; - update->BeginPaint(gdi->context); + if (!IFCALLRESULT(TRUE, update->BeginPaint, gdi->context)) + goto fail; for (i = 0; i < nbRects; i++) { @@ -139,9 +141,13 @@ static UINT gdi_OutputUpdate(rdpGdi* gdi, gdiGfxSurface* surface) gdi_InvalidateRegion(gdi->primary->hdc, nXDst, nYDst, width, height); } - update->EndPaint(gdi->context); + if (!IFCALLRESULT(FALSE, update->EndPaint, gdi->context)) + goto fail; + + rc = CHANNEL_RC_OK; +fail: region16_clear(&(surface->invalidRegion)); - return CHANNEL_RC_OK; + return rc; } static UINT gdi_UpdateSurfaces(RdpgfxClientContext* context)