[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58216] trunk/blender/source/blender: correct bad allocation sizes, unwrap was over-allocating, makesdna was under allocating.
Campbell Barton
ideasman42 at gmail.com
Sat Jul 13 16:19:57 CEST 2013
Revision: 58216
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58216
Author: campbellbarton
Date: 2013-07-13 14:19:57 +0000 (Sat, 13 Jul 2013)
Log Message:
-----------
correct bad allocation sizes, unwrap was over-allocating, makesdna was under allocating.
Modified Paths:
--------------
trunk/blender/source/blender/editors/uvedit/uvedit_parametrizer.c
trunk/blender/source/blender/makesdna/intern/makesdna.c
Modified: trunk/blender/source/blender/editors/uvedit/uvedit_parametrizer.c
===================================================================
--- trunk/blender/source/blender/editors/uvedit/uvedit_parametrizer.c 2013-07-13 14:16:59 UTC (rev 58215)
+++ trunk/blender/source/blender/editors/uvedit/uvedit_parametrizer.c 2013-07-13 14:19:57 UTC (rev 58216)
@@ -3682,8 +3682,8 @@
if (ntri <= 10 || depth >= 15)
return node;
- t1 = MEM_mallocN(sizeof(SmoothTriangle) * ntri, "PNodeTri1");
- t2 = MEM_mallocN(sizeof(SmoothTriangle) * ntri, "PNodeTri1");
+ t1 = MEM_mallocN(sizeof(*t1) * ntri, "PNodeTri1");
+ t2 = MEM_mallocN(sizeof(*t2) * ntri, "PNodeTri1");
axis = (bmax[0] - bmin[0] > bmax[1] - bmin[1]) ? 0 : 1;
split = 0.5f * (bmin[axis] + bmax[axis]);
Modified: trunk/blender/source/blender/makesdna/intern/makesdna.c
===================================================================
--- trunk/blender/source/blender/makesdna/intern/makesdna.c 2013-07-13 14:16:59 UTC (rev 58215)
+++ trunk/blender/source/blender/makesdna/intern/makesdna.c 2013-07-13 14:19:57 UTC (rev 58216)
@@ -965,7 +965,7 @@
types = MEM_callocN(sizeof(char *) * maxnr, "types");
typelens_native = MEM_callocN(sizeof(short) * maxnr, "typelens_native");
typelens_64 = MEM_callocN(sizeof(short) * maxnr, "typelens_64");
- structs = MEM_callocN(sizeof(short) * maxnr, "structs");
+ structs = MEM_callocN(sizeof(short *) * maxnr, "structs");
/* insertion of all known types */
/* watch it: uint is not allowed! use in structs an unsigned int */
More information about the Bf-blender-cvs
mailing list