mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-gdi: fix segfault in fast_index.
This commit is contained in:
parent
74ba2b3515
commit
27a82cccfa
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue