Fix for corruption during color conversion on Windows.
authorunknown <jason@Aldebaran.(none)>
Tue, 19 Jun 2012 22:32:10 +0000 (15:32 -0700)
committerunknown <jason@Aldebaran.(none)>
Tue, 19 Jun 2012 22:32:10 +0000 (15:32 -0700)
client/Windows/wf_graphics.c

index a79628f..d6cfeef 100644 (file)
@@ -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;