libfreerdp-gdi: fix segfault in fast_index.

This commit is contained in:
Vic Lee 2011-09-20 20:15:15 +08:00
parent 74ba2b3515
commit 27a82cccfa
2 changed files with 5 additions and 2 deletions

View File

@ -443,8 +443,8 @@ INLINE uint16 update_read_glyph_fragments(STREAM* s, GLYPH_FRAGMENT** fragments,
array_mark = NULL;
stream_end = s->p + size;
stream_get_mark(s, stream_start);
offsets = (uint8**) xmalloc(size / 2);
lengths = (uint16*) xmalloc(size / 2);
offsets = (uint8**) xmalloc(sizeof(uint8*) * size / 2);
lengths = (uint16*) xmalloc(sizeof(uint16) * size / 2);
operations = (uint8*) xmalloc(size / 2);
while (s->p < stream_end)

View File

@ -724,6 +724,9 @@ void gdi_fast_index(rdpUpdate* update, FAST_INDEX_ORDER* fast_index)
bmp = bmps[j];
glyph = glyphs[j];
if (bmp == NULL || glyph == NULL)
continue;
gdi_BitBlt(gdi->drawing->hdc, glyph->x + x, glyph->y + y, bmp->bitmap->width,
bmp->bitmap->height, bmp->hdc, 0, 0, GDI_DSPDxax);