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:
authorIRIE Shinsuke <irieshinsuke@yahoo.co.jp>2017-01-26 18:15:49 +0300
committerIRIE Shinsuke <irieshinsuke@yahoo.co.jp>2017-01-26 18:36:24 +0300
commitf14e1da5aae4ef6de0f8ad5ae5b393bc9d19a726 (patch)
treeab8fbff2992c49c127b5326769f487fa15d3735e /source/blender/blenfont
parent3c3c52a74b3fd59496bae7868951b0ef71510d5d (diff)
Fix (unreported) crash when file browser attempts to show preview of some defective font
Confirmed with the Wine's bundled fonts.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_thumbs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_thumbs.c b/source/blender/blenfont/intern/blf_thumbs.c
index 133168fccf2..b6f5ffbb092 100644
--- a/source/blender/blenfont/intern/blf_thumbs.c
+++ b/source/blender/blenfont/intern/blf_thumbs.c
@@ -98,6 +98,10 @@ void BLF_thumb_preview(
blf_font_size(font, (unsigned int)MAX2(font_size_min, font_size_curr), dpi);
+ /* font->glyph_cache remains NULL if blf_font_size() failed to set font size */
+ if (!font->glyph_cache)
+ break;
+
/* decrease font size each time */
font_size_curr -= (font_size_curr / font_shrink);
font_shrink += 1;