Fix for bad colours on ARM (found by Ken Gordon) - we can't assume that

the representation of a COLOURENTRY array is the same as on the wire.
Copy method of process_colcache to process_palette.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@253 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Matt Chapman 2002-11-05 11:22:20 +00:00
parent c96a91367d
commit 280a1d5289

19
rdp.c
View File

@ -601,18 +601,29 @@ process_bitmap_updates(STREAM s)
static void
process_palette(STREAM s)
{
HCOLOURMAP hmap;
COLOURENTRY *entry;
COLOURMAP map;
uint8 *colours;
HCOLOURMAP hmap;
int i;
in_uint8s(s, 2); /* pad */
in_uint16_le(s, map.ncolours);
in_uint8s(s, 2); /* pad */
in_uint8p(s, colours, (map.ncolours * 3));
map.colours = (COLOURENTRY *) colours;
map.colours = xmalloc(3 * map.ncolours);
for (i = 0; i < map.ncolours; i++)
{
entry = &map.colours[i];
in_uint8(s, entry->red);
in_uint8(s, entry->green);
in_uint8(s, entry->blue);
}
hmap = ui_create_colourmap(&map);
ui_set_colourmap(hmap);
xfree(map.colours);
}
/* Process an update PDU */