diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-22 15:07:58 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-22 15:11:09 +0300 |
commit | dc06bf2cb6b1289cdb90b960b8f125f99e57946b (patch) | |
tree | e306e8727420606f99003b442d2a3b6acc97bc8c /source/blender/blenfont/intern/blf_font.c | |
parent | 0c824837ab08822b95c24d33f561213f20ce3cbd (diff) |
Fix crash loading fonts that fail to be read
Null pointer dereference since [0] when font's can't be read.
[0]: d39abb74a0a99fde2c9d845821d52c198ae4da24
Diffstat (limited to 'source/blender/blenfont/intern/blf_font.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index eaea88be9ae..fcded5a13cd 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -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); } |