Prevent this error (caught with SANITIZER=undefined)

This commit is contained in:
twinaphex 2016-09-18 22:39:18 +02:00
parent 050ab56038
commit 88c2ec5819

View File

@ -112,7 +112,7 @@ static bool font_renderer_create_atlas(ft_font_renderer_t *handle)
glyph->draw_offset_x = slot->bitmap_left;
glyph->draw_offset_y = -slot->bitmap_top;
if (buffer[i])
if (buffer[i] && slot->bitmap.buffer)
memcpy(buffer[i], slot->bitmap.buffer,
slot->bitmap.rows * pitches[i]);
max_width = MAX(max_width, (unsigned)slot->bitmap.width);