From d10448fde233055b98dc7bc226119aabe8ee9492 Mon Sep 17 00:00:00 2001 From: daixj Date: Wed, 29 Nov 2017 05:12:40 -0500 Subject: [PATCH] Fix #4291: xfreerdp segfault when connecting freerdp-shadow-cli --- libfreerdp/gdi/gdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index e099ecfc5..af6ac5a1f 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -1149,11 +1149,11 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format, buffer, pfree); } - gdi->stride = gdi->primary->bitmap->scanline; - if (!gdi->primary->bitmap) goto fail_bitmap; + gdi->stride = gdi->primary->bitmap->scanline; + gdi_SelectObject(gdi->primary->hdc, (HGDIOBJECT) gdi->primary->bitmap); gdi->primary->org_bitmap = NULL; gdi->primary_buffer = gdi->primary->bitmap->data;