Author: phater
Date: Tue May 16 17:32:19 2017
New Revision: 74560
URL:
http://svn.reactos.org/svn/reactos?rev=74560&view=rev
Log:
[MSTSC] Fix image corruption in 24bpp mode CORE-13224
Modified:
trunk/reactos/base/applications/mstsc/uimain.c
trunk/reactos/base/applications/mstsc/win32.c
Modified: trunk/reactos/base/applications/mstsc/uimain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/ui…
==============================================================================
--- trunk/reactos/base/applications/mstsc/uimain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/uimain.c [iso-8859-1] Tue May 16 17:32:19 2017
@@ -199,7 +199,7 @@
{
bs_set_pixel_on(am, j, 31 - i, 32, 1, 1);
}
- if (bs_is_pixel_on((char *)xormask, j, i, 32, 24))
+ if (bs_is_pixel_on((char *)xormask, j, i, 32, xor_bpp))
{
bs_set_pixel_on(xm, j, 31 - i, 32, 1, 1);
}
Modified: trunk/reactos/base/applications/mstsc/win32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/wi…
==============================================================================
--- trunk/reactos/base/applications/mstsc/win32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/win32.c [iso-8859-1] Tue May 16 17:32:19 2017
@@ -886,6 +886,7 @@
int red;
int green;
int blue;
+ int index;
ZeroMemory(&bi, sizeof(bi));
bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
@@ -942,7 +943,22 @@
}
}
}
- else if (g_server_depth == 24 || g_server_depth == 32)
+ else if (g_server_depth == 24)
+ {
+ for (i = cy - 1; i >= 0; i--)
+ {
+ for (j = cx - 1; j >= 0; j--)
+ {
+ index = (i * cx + j) * 3;
+ red = ((unsigned char*)data)[index + 2];
+ green = ((unsigned char*)data)[index + 1];
+ blue = ((unsigned char*)data)[index];
+ MAKE_COLOUR32(colour, red, green, blue);
+ ((unsigned int*)bits)[i * cx + j] = colour;
+ }
+ }
+ }
+ else if (g_server_depth == 32)
{
memcpy(bits, data, cx*cy*4);
}