[Bf-blender-cvs] [6b283f1] master: Fix for BLF using realloc() on guarded-alloced memory

Campbell Barton noreply at git.blender.org
Thu Jan 16 16:15:17 CET 2014


Commit: 6b283f1168295cf3b88fd29aa09f88feb10c1137
Author: Campbell Barton
Date:   Fri Jan 17 02:13:55 2014 +1100
https://developer.blender.org/rB6b283f1168295cf3b88fd29aa09f88feb10c1137

Fix for BLF using realloc() on guarded-alloced memory

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

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 2a8e912..8a734f9 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -162,7 +162,7 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
 
 	if (gc->cur_tex >= gc->ntex) {
 		gc->ntex *= 2;
-		gc->textures = (GLuint *)realloc((void *)gc->textures, sizeof(GLuint) * gc->ntex);
+		gc->textures = (GLuint *)MEM_reallocN((void *)gc->textures, sizeof(GLuint) * gc->ntex);
 	}
 
 	gc->p2_width = (int)blf_next_p2((unsigned int)((gc->rem_glyphs * gc->max_glyph_width) + (gc->pad * 2)));




More information about the Bf-blender-cvs mailing list