diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index da3790902..15b5f823d 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -43,7 +43,7 @@ void xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) if (bitmap->data != NULL) { data = freerdp_image_convert(bitmap->data, NULL, - bitmap->width, bitmap->height, bitmap->bpp, xfi->bpp, xfi->clrconv); + bitmap->width, bitmap->height, xfi->srcBpp, xfi->bpp, xfi->clrconv); if (bitmap->ephemeral != True) { @@ -106,7 +106,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, { uint16 size; - size = width * height * (bpp / 8); + size = width * height * (bpp + 7) / 8; if (bitmap->data == NULL) bitmap->data = (uint8*) xmalloc(size); diff --git a/libfreerdp-codec/color.c b/libfreerdp-codec/color.c index 21b505466..cb8862698 100644 --- a/libfreerdp-codec/color.c +++ b/libfreerdp-codec/color.c @@ -97,7 +97,7 @@ uint32 freerdp_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCO case 32: if (clrconv->alpha) { - GetABGR32(alpha, red, green, blue, srcColor); + GetARGB32(alpha, red, green, blue, srcColor); } else { @@ -108,10 +108,10 @@ uint32 freerdp_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCO GetBGR24(red, green, blue, srcColor); break; case 16: - GetRGB16(red, green, blue, srcColor); + GetBGR16(red, green, blue, srcColor); break; case 15: - GetRGB15(red, green, blue, srcColor); + GetBGR15(red, green, blue, srcColor); break; case 8: srcColor &= 0xFF; @@ -133,7 +133,7 @@ uint32 freerdp_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCO switch (dstBpp) { case 32: - dstColor = ARGB32(alpha, red, green, blue); + dstColor = ABGR32(alpha, red, green, blue); break; case 24: dstColor = BGR24(red, green, blue); @@ -372,7 +372,7 @@ uint8* freerdp_image_convert_15bpp(uint8* srcData, uint8* dstData, int width, in { pixel = *src16; src16++; - GetBGR16(red, green, blue, pixel); + GetBGR15(red, green, blue, pixel); pixel = BGR32(red, green, blue); *dst32 = pixel; dst32++; diff --git a/libfreerdp-gdi/graphics.c b/libfreerdp-gdi/graphics.c index c903fcdd8..516bab00c 100644 --- a/libfreerdp-gdi/graphics.c +++ b/libfreerdp-gdi/graphics.c @@ -83,7 +83,7 @@ void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, { uint16 size; - size = width * height * (bpp / 8); + size = width * height * (bpp + 7) / 8; if (bitmap->data == NULL) bitmap->data = (uint8*) xmalloc(size);