Fix #115167: crash opening files with missing fonts on disk

Check for linked fonts not found on disk.

Pull Request: https://projects.blender.org/blender/blender/pulls/115168
This commit is contained in:
Philipp Oeser
2023-11-20 18:34:32 +01:00
committed by Harley Acheson
parent 4edc138933
commit e2fbcb4632

View File

@@ -354,6 +354,11 @@ VChar *BKE_vfontdata_char_from_freetypefont(VFont *vfont, ulong character)
return nullptr;
}
/* nullptr when the font file can't be found on disk. */
if (vfont->temp_pf == nullptr) {
return nullptr;
}
/* Initialize Freetype. */
FT_Library library = nullptr;
FT_Error err = FT_Init_FreeType(&library);