[Bf-blender-cvs] [6a8a6790372] master: BLF: avoid glyph cache use-after free

Campbell Barton noreply at git.blender.org
Fri Apr 14 11:54:17 CEST 2017


Commit: 6a8a67903729d0e8bb44e15547f827b2b5638ba5
Author: Campbell Barton
Date:   Fri Apr 14 19:52:29 2017 +1000
Branches: master
https://developer.blender.org/rB6a8a67903729d0e8bb44e15547f827b2b5638ba5

BLF: avoid glyph cache use-after free

Causes crash if the font size isn't set after clearing (see T51200)

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

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

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

diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index aa7d539538b..bbbabfb8ba2 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -135,6 +135,7 @@ void blf_glyph_cache_clear(FontBLF *font)
 	while ((gc = BLI_pophead(&font->cache))) {
 		blf_glyph_cache_free(gc);
 	}
+	font->glyph_cache = NULL;
 }
 
 void blf_glyph_cache_free(GlyphCacheBLF *gc)




More information about the Bf-blender-cvs mailing list