summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_bitmap.c
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-12-16 23:46:09 +0000
committerPavel Roskin <plroskin@gmail.com>2016-12-18 09:24:06 -0800
commit77d6fd08076088afde1ac1a445cbf9c1dedfe726 (patch)
tree968e92c5cd3443b6e44ccdc394f2ee730ce60083 /xrdp/xrdp_bitmap.c
parent2d8d786a9d518e2d8d1dc0d84ca06bc27461c86f (diff)
downloadxrdp-proprietary-77d6fd08076088afde1ac1a445cbf9c1dedfe726.tar.gz
xrdp-proprietary-77d6fd08076088afde1ac1a445cbf9c1dedfe726.zip
Fix Parallels Client on Mac
self->line_size should be calculated in xrdp_bitmap_create_with_data() The code was in the original noorders branch but got lost. Without this fix, the image is garbled. The client should be configured with compression disabled, or it will disconnect. That's a known problem.
Diffstat (limited to 'xrdp/xrdp_bitmap.c')
-rw-r--r--xrdp/xrdp_bitmap.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c
index 9ffc6284..053be88b 100644
--- a/xrdp/xrdp_bitmap.c
+++ b/xrdp/xrdp_bitmap.c
@@ -149,9 +149,9 @@ xrdp_bitmap_create_with_data(int width, int height,
struct xrdp_wm *wm)
{
struct xrdp_bitmap *self = (struct xrdp_bitmap *)NULL;
+ int Bpp;
#if defined(NEED_ALIGN)
tintptr data_as_int;
- int Bpp;
#endif
self = (struct xrdp_bitmap *)g_malloc(sizeof(struct xrdp_bitmap), 1);
@@ -160,6 +160,22 @@ xrdp_bitmap_create_with_data(int width, int height,
self->height = height;
self->bpp = bpp;
self->wm = wm;
+
+ Bpp = 4;
+ switch (bpp)
+ {
+ case 8:
+ Bpp = 1;
+ break;
+ case 15:
+ Bpp = 2;
+ break;
+ case 16:
+ Bpp = 2;
+ break;
+ }
+ self->line_size = width * Bpp;
+
#if defined(NEED_ALIGN)
data_as_int = (tintptr) data;
if (((bpp >= 24) && (data_as_int & 3)) ||
@@ -167,19 +183,6 @@ xrdp_bitmap_create_with_data(int width, int height,
{
/* got to copy data here, it's not aligned
other calls in this file assume alignment */
- Bpp = 4;
- switch (bpp)
- {
- case 8:
- Bpp = 1;
- break;
- case 15:
- Bpp = 2;
- break;
- case 16:
- Bpp = 2;
- break;
- }
self->data = (char *)g_malloc(width * height * Bpp, 0);
g_memcpy(self->data, data, width * height * Bpp);
return self;