From 88c2ec5819e4258ad9d881c32628b7011409a7d3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 18 Sep 2016 22:39:18 +0200 Subject: [PATCH] Prevent this error (caught with SANITIZER=undefined) --- gfx/drivers_font_renderer/freetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/drivers_font_renderer/freetype.c b/gfx/drivers_font_renderer/freetype.c index cd2a58c162..654037c824 100644 --- a/gfx/drivers_font_renderer/freetype.c +++ b/gfx/drivers_font_renderer/freetype.c @@ -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);