Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenfont/intern/blf_font.c4
-rw-r--r--source/blender/blenfont/intern/blf_font_default.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 886c34654c4..fb157c71172 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -110,6 +110,10 @@ static FT_Error blf_cache_face_requester(FTC_FaceID faceID,
font->face->generic.data = font;
font->face->generic.finalizer = blf_face_finalizer;
}
+ else {
+ /* Clear this on error to avoid exception in FTC_Manager_LookupFace. */
+ *face = NULL;
+ }
return err;
}
diff --git a/source/blender/blenfont/intern/blf_font_default.c b/source/blender/blenfont/intern/blf_font_default.c
index a88da6099e5..ffeee397c20 100644
--- a/source/blender/blenfont/intern/blf_font_default.c
+++ b/source/blender/blenfont/intern/blf_font_default.c
@@ -65,7 +65,9 @@ void BLF_load_font_stack()
struct direntry *dir;
uint num_files = BLI_filelist_dir_contents(path, &dir);
for (int f = 0; f < num_files; f++) {
- if (!FILENAME_IS_CURRPAR(dir[f].relname) && !BLI_is_dir(dir[f].path)) {
+ if (!BLI_is_dir(dir[f].path) &&
+ BLI_path_extension_check_n(
+ dir[f].path, ".ttf", ".ttc", ".otf", ".otc", ".woff", ".woff2", NULL)) {
if (!BLF_is_loaded(dir[f].path)) {
int font_id = BLF_load(dir[f].path);
if (font_id == -1) {