From d08e82c1710280cef7d7e683268dc956aa4022e7 Mon Sep 17 00:00:00 2001 From: Nicolas Graziano Date: Wed, 12 Oct 2011 02:19:14 +0200 Subject: [PATCH] Correct creation of offscreen bitmap. data is null in xf_bitmap_new when called from xf_gdi_create_offscreen_bitmap. --- client/X11/xf_gdi.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index 9ee5d9e91..25424f2e6 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -202,16 +202,17 @@ Pixmap xf_bitmap_new(xfInfo* xfi, int width, int height, int bpp, uint8* data) bitmap = XCreatePixmap(xfi->display, xfi->drawable, width, height, xfi->depth); - cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv); + if(data != NULL) + { + cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv); + image = XCreateImage(xfi->display, xfi->visual, xfi->depth, + ZPixmap, 0, (char*) cdata, width, height, xfi->scanline_pad, 0); - image = XCreateImage(xfi->display, xfi->visual, xfi->depth, - ZPixmap, 0, (char*) cdata, width, height, xfi->scanline_pad, 0); - - XPutImage(xfi->display, bitmap, xfi->gc, image, 0, 0, 0, 0, width, height); - XFree(image); - - if (cdata != data) - xfree(cdata); + XPutImage(xfi->display, bitmap, xfi->gc, image, 0, 0, 0, 0, width, height); + XFree(image); + if (cdata != data) + xfree(cdata); + } return bitmap; }