libfreerdp-core: fix cache glyph order parsing

This commit is contained in:
Marc-André Moreau 2011-09-07 13:45:25 -04:00
parent 93d09e1a38
commit a65d8c0367
3 changed files with 9 additions and 3 deletions

View File

@ -567,8 +567,8 @@ typedef struct _CACHE_COLOR_TABLE_ORDER CACHE_COLOR_TABLE_ORDER;
struct _GLYPH_DATA
{
uint16 cacheIndex;
uint16 x;
uint16 y;
sint16 x;
sint16 y;
uint16 cx;
uint16 cy;
uint16 cb;

View File

@ -1155,6 +1155,7 @@ void update_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_O
stream_read_uint8(s, cbData);
stream_get_mark(s, mark);
mark += cbData;
if ((fast_index->ulCharInc == 0) && !(fast_index->flAccel & SO_CHAR_INC_EQUAL_BM_BASE))
delta = True;
@ -1487,12 +1488,15 @@ void update_read_cache_glyph_order(STREAM* s, CACHE_GLYPH_ORDER* cache_glyph_ord
stream_read_uint16(s, glyph->cy);
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += glyph->cb % 4;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
glyph->aj = (uint8*) xmalloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
}
if (flags & CG_GLYPH_UNICODE_PRESENT)
stream_seek(s, cache_glyph_order->cGlyphs * 2);
}
void update_read_cache_glyph_v2_order(STREAM* s, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order, uint16 flags)

View File

@ -197,6 +197,8 @@
#define ORDER_TYPE_COMPDESK_FIRST 0x0C
#define ORDER_TYPE_FRAME_MARKER 0x0D
#define CG_GLYPH_UNICODE_PRESENT 0x0010
void update_recv_order(rdpUpdate* update, STREAM* s);
void update_read_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, DSTBLT_ORDER* dstblt);