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:
authorCampbell Barton <ideasman42@gmail.com>2016-02-19 01:40:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-02-19 01:40:26 +0300
commit60e53e0ce68a1823b3a20b007181f23b2c5c7453 (patch)
tree7c3325e0bb0a3f3d7a8275cbc1ee8e392ded4200 /source/blender/blenfont
parent2fbdf9adc7486498d378a938f034e4ef3ee840d1 (diff)
Fix crash drawing fonts at size 1
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 1c13e42f70d..41726e41176 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -113,6 +113,10 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
gc->max_glyph_height = (int)(((float)font->face->size->metrics.height) / 64.0f);
}
+ /* can happen with size 1 fonts */
+ CLAMP_MIN(gc->max_glyph_width, 1);
+ CLAMP_MIN(gc->max_glyph_height, 1);
+
gc->p2_width = 0;
gc->p2_height = 0;