[MSTSC] Fix image corruption in 24bpp mode CORE-13224

svn path=/trunk/; revision=74560
This commit is contained in:
Peter Hater 2017-05-16 17:32:19 +00:00
parent 44f1cf17c7
commit 450b66d358
2 changed files with 18 additions and 2 deletions

View file

@ -199,7 +199,7 @@ ui_create_cursor(unsigned int x, unsigned int y,
{
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);
}

View file

@ -886,6 +886,7 @@ mi_paint_rect(char * data, int width, int height, int x, int y, int cx, int cy)
int red;
int green;
int blue;
int index;
ZeroMemory(&bi, sizeof(bi));
bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
@ -942,7 +943,22 @@ mi_paint_rect(char * data, int width, int height, int x, int y, int cx, int cy)
}
}
}
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);
}