[Bf-blender-cvs] [1bd8a829608] blender2.8: Fix assert failure when trying to draw empty string

Sergey Sharybin noreply at git.blender.org
Fri Nov 10 16:31:31 CET 2017


Commit: 1bd8a82960823268b1cadc2273c2cc1647422041
Author: Sergey Sharybin
Date:   Fri Nov 10 16:29:35 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB1bd8a82960823268b1cadc2273c2cc1647422041

Fix assert failure when trying to draw empty string

===================================================================

M	source/blender/blenfont/intern/blf_font.c

===================================================================

diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 03f62cbb6ea..5846f7a29e4 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -202,6 +202,11 @@ static void blf_font_draw_ex(
 	size_t i = 0;
 	GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
 
+	if (len == 0) {
+		/* early output, don't do any IMM OpenGL. */
+		return;
+	}
+
 	BLF_KERNING_VARS(font, has_kerning, kern_mode);
 
 	blf_font_ensure_ascii_table(font);



More information about the Bf-blender-cvs mailing list