From a34ecc48b03c445cce604ae0130820a475628747 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Jun 2012 15:32:10 -0700 Subject: [PATCH] Fix for corruption during color conversion on Windows. --- client/Windows/wf_graphics.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/Windows/wf_graphics.c b/client/Windows/wf_graphics.c index a79628f..d6cfeef 100644 --- a/client/Windows/wf_graphics.c +++ b/client/Windows/wf_graphics.c @@ -39,18 +39,17 @@ HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, uint8* data, */ negHeight = (height < 0) ? height : height * (-1); - hdc = GetDC(NULL); bmi.bmiHeader.biSize = sizeof(BITMAPINFO); bmi.bmiHeader.biWidth = width; bmi.bmiHeader.biHeight = negHeight; bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = bpp; + bmi.bmiHeader.biBitCount = wfi->dstBpp; bmi.bmiHeader.biCompression = BI_RGB; bitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**) &cdata, NULL, 0); if (data != NULL) - freerdp_image_convert(data, cdata, width, height, bpp, bpp, wfi->clrconv); + freerdp_image_convert(data, cdata, width, height, bpp, wfi->dstBpp, wfi->clrconv); if (pdata != NULL) *pdata = cdata; -- 2.7.4