Fix crash loading fonts that fail to be read

Null pointer dereference since [0] when font's can't be read.

[0]: d39abb74a0
This commit is contained in:
Campbell Barton
2022-09-22 22:07:58 +10:00
parent 0c824837ab
commit dc06bf2cb6

View File

@@ -1346,7 +1346,9 @@ bool blf_ensure_face(FontBLF *font)
if (font->mem) {
err = FT_New_Memory_Face(font->ft_lib, font->mem, (FT_Long)font->mem_size, 0, &font->face);
}
font->face->generic.data = font;
if (!err) {
font->face->generic.data = font;
}
BLI_mutex_unlock(&ft_lib_mutex);
}