Fix T67117: Font thumbnails crash to desktop

We were missing a null pointer check for invalid fonts.
temp-D5423-update
Sebastian Parborg 4 years ago
parent 53944e2f9f
commit 52fb8b1e80

@ -96,7 +96,7 @@ KerningCacheBLF *blf_kerning_cache_new(FontBLF *font)
.x = 0,
.y = 0,
};
if (g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) {
if (g && 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 {

Loading…
Cancel
Save