--- freerdp/libfreerdp-cache/glyph.c 2012-01-01 22:42:57.000000000 0100 +++ freerdp/libfreerdp-cache/glyph.c 2012-01-01 22:42:57.000000000 0100 @@ -323,7 +323,27 @@ void update_gdi_cache_glyph_v2(rdpContext* context, CACHE_GLYPH_V2_ORDER* cache_glyph_v2) { + int i; + rdpGlyph* glyph; + GLYPH_DATA_V2* glyph_data; + rdpCache* cache = context->cache; + + for (i = 0; i < (int) cache_glyph_v2->cGlyphs; i++) + { + glyph_data = cache_glyph_v2->glyphData[i]; + + glyph = Glyph_Alloc(context); + glyph->x = glyph_data->x; + glyph->y = glyph_data->y; + glyph->cx = glyph_data->cx; + glyph->cy = glyph_data->cy; + glyph->aj = glyph_data->aj; + glyph->cb = glyph_data->cb; + Glyph_New(context, glyph); + + glyph_cache_put(cache->glyph, cache_glyph_v2->cacheId, glyph_data->cacheIndex, glyph); + } } rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint32 id, uint32 index) --- freerdp/libfreerdp-core/orders.c 2012-01-02 22:08:14.000000000 0100 +++ freerdp/libfreerdp-core/orders.c 2012-01-02 22:08:14.000000000 0100 @@ -1059,7 +1059,7 @@ update_read_2byte_unsigned(s, &glyph->cx); update_read_2byte_unsigned(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); fast_glyph->glyph_data = glyph; @@ -1365,19 +1365,22 @@ glyph = (GLYPH_DATA_V2*) xmalloc(sizeof(GLYPH_DATA_V2)); cache_glyph_v2_order->glyphData[i] = glyph; - stream_read_uint16(s, glyph->cacheIndex); + stream_read_uint8(s, glyph->cacheIndex); update_read_2byte_signed(s, &glyph->x); update_read_2byte_signed(s, &glyph->y); update_read_2byte_unsigned(s, &glyph->cx); update_read_2byte_unsigned(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_v2_order->cGlyphs * 2); } void update_decompress_brush(STREAM* s, uint8* output, uint8 bpp)