diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2019-03-26 16:08:42 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2019-03-26 16:11:35 +0300 |
commit | b2656a6ee4d554fdd6dcf9cc0d9427d1a8307a10 (patch) | |
tree | 1ead2dfc0b145ac429fa30d70e915895591f6085 /source/blender/blenfont | |
parent | c2c6083c147c83e5a38eb0357634fa26e612dd80 (diff) |
Fix T62887: When searching for fonts, thumbnail display mode will crash Blender
We do not support special color fonts (like colored emoji fonts), so
don't crash when trying to create a preview for unsupported fonts.
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D4590
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 27e67f700bc..20cd6a51a47 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -89,11 +89,11 @@ KerningCacheBLF *blf_kerning_cache_new(FontBLF *font) FT_UInt glyph_index = FT_Get_Char_Index(font->face, i); g = blf_glyph_add(font, glyph_index, i); } - /* Cannot fail since it has been added just before. */ + /* Can fail on certain fonts */ GlyphBLF *g_prev = blf_glyph_search(font->glyph_cache, j); FT_Vector delta = { .x = 0, .y = 0, }; - if (FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) { + if (g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) { kc->table[i][j] = (int)delta.x >> 6; } else { |