diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-13 18:19:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-13 18:19:57 +0400 |
commit | 7a3d0bac1a5adc85899c102c8b798fb363816712 (patch) | |
tree | 95866dbfc231e21b5370e7771f7ebb0145f72340 | |
parent | 1c15beb6b225826c0a0d83d4df58a0bac7ce0ed5 (diff) |
correct bad allocation sizes, unwrap was over-allocating, makesdna was under allocating.
-rw-r--r-- | source/blender/editors/uvedit/uvedit_parametrizer.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/intern/makesdna.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 6f92c1873d6..18f4e8cafaf 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -3682,8 +3682,8 @@ static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, f 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]); diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 29c977bfe64..2665da1b435 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -965,7 +965,7 @@ static int make_structDNA(const char *baseDirectory, FILE *file) 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 */ |