[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25381] trunk/blender/source/blender/ blenkernel/intern/font.c: Fix #20233: crash when entering - characters in text object, with short

Brecht Van Lommel brecht at blender.org
Mon Dec 14 21:01:53 CET 2009


Revision: 25381
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25381
Author:   blendix
Date:     2009-12-14 21:01:52 +0100 (Mon, 14 Dec 2009)

Log Message:
-----------
Fix #20233: crash when entering - characters in text object, with short
textbox width. I can't tell if this is working correct, the code is very
cryptic, with gotos even, but seems there is not enough space allocated
to permit splitting each character to it's own line.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/font.c

Modified: trunk/blender/source/blender/blenkernel/intern/font.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/font.c	2009-12-14 19:39:54 UTC (rev 25380)
+++ trunk/blender/source/blender/blenkernel/intern/font.c	2009-12-14 20:01:52 UTC (rev 25381)
@@ -705,10 +705,10 @@
 
 	/* We assume the worst case: 1 character per line (is freed at end anyway) */
 
-	linedata= MEM_mallocN(sizeof(float)*(slen+2),"buildtext2");
-	linedata2= MEM_mallocN(sizeof(float)*(slen+2),"buildtext3");
-	linedata3= MEM_callocN(sizeof(float)*(slen+2),"buildtext4");	
-	linedata4= MEM_callocN(sizeof(float)*(slen+2),"buildtext5");		
+	linedata= MEM_mallocN(sizeof(float)*(slen*2 + 1),"buildtext2");
+	linedata2= MEM_mallocN(sizeof(float)*(slen*2 + 1),"buildtext3");
+	linedata3= MEM_callocN(sizeof(float)*(slen*2 + 1),"buildtext4");	
+	linedata4= MEM_callocN(sizeof(float)*(slen*2 + 1),"buildtext5");		
 	
 	linedist= cu->linedist;
 	





More information about the Bf-blender-cvs mailing list