Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-06-19 09:13:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-06-19 09:30:08 +0400
commit804f58c0de0f58760e16f0b29fc7d245aa7a16f3 (patch)
tree5466cbfe5244f880eb226682daee0c2423fec6ab /source/blender/blenkernel/intern/curve.c
parent70b8a8daf86bcc1d78a46f8aef90597e9befdb60 (diff)
Curve: zero memory on access rather then calloc
also remove redundant check
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r--source/blender/blenkernel/intern/curve.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 8bc22b590b6..0abe956b599 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -1085,12 +1085,6 @@ void BKE_nurb_makeFaces(Nurb *nu, float *coord_array, int rowstride, int resolu,
sum = (float *)MEM_callocN(sizeof(float) * len, "makeNurbfaces1");
- len = totu * totv;
- if (len == 0) {
- MEM_freeN(sum);
- return;
- }
-
bp = nu->bp;
i = nu->pntsu * nu->pntsv;
ratcomp = 0;
@@ -1193,6 +1187,8 @@ void BKE_nurb_makeFaces(Nurb *nu, float *coord_array, int rowstride, int resolu,
}
}
+ zero_v3(in);
+
/* one! (1.0) real point now */
fp = sum;
for (j = jsta; j <= jen; j++) {
@@ -1307,6 +1303,8 @@ void BKE_nurb_makeCurve(Nurb *nu, float *coord_array, float *tilt_array, float *
}
}
+ zero_v3(coord_fp);
+
/* one! (1.0) real point */
fp = sum;
bp = nu->bp + istart - 1;
@@ -1473,7 +1471,7 @@ float *BKE_curve_surf_make_orco(Object *ob)
}
else {
int size = (nu->pntsu * resolu) * (nu->pntsv * resolv) * 3 * sizeof(float);
- float *_tdata = MEM_callocN(size, "temp data");
+ float *_tdata = MEM_mallocN(size, "temp data");
float *tdata = _tdata;
BKE_nurb_makeFaces(nu, tdata, 0, resolu, resolv);