correct bad allocation sizes, unwrap was over-allocating, makesdna was under allocating.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 13 Jul 2013 14:19:57 +0000 (14:19 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 13 Jul 2013 14:19:57 +0000 (14:19 +0000)
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/makesdna/intern/makesdna.c

index 6f92c1873d6f9f6752a9e04bcc92c91e88714702..18f4e8cafaf0ee9b10c690cdce98b0c829070dcf 100644 (file)
@@ -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]);
index 29c977bfe6480a43d5b3554765d390d7aba1cfed..2665da1b435f771df6d0d4d5152b3f649ac36a81 100644 (file)
@@ -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 */