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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-07-30 22:49:40 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-07-30 22:49:40 +0400
commit61c9c82b627d637c72a09fe3e78875fd9ba2b21f (patch)
treeda098ba9731e8dea27c024477d6e061094e87e64 /source/blender/blenkernel/intern/key.c
parent3d57740a388f526c4598ba0d69216ba2268d0e04 (diff)
Use malloc in cases when data is getting overwriten after allocation.
Diffstat (limited to 'source/blender/blenkernel/intern/key.c')
-rw-r--r--source/blender/blenkernel/intern/key.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index a79fa3873f5..5b8929e49fe 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -533,7 +533,7 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **
if (me->edit_btmesh && me->edit_btmesh->bm->totvert == kb->totelem) {
a = 0;
- co = MEM_callocN(sizeof(float) * 3 * me->edit_btmesh->bm->totvert, "key_block_get_data");
+ co = MEM_mallocN(sizeof(float) * 3 * me->edit_btmesh->bm->totvert, "key_block_get_data");
BM_ITER_MESH (eve, &iter, me->edit_btmesh->bm, BM_VERTS_OF_MESH) {
copy_v3_v3(co[a], eve->co);
@@ -1091,7 +1091,7 @@ static float *get_weights_array(Object *ob, char *vgroup)
float *weights;
int i;
- weights = MEM_callocN(totvert * sizeof(float), "weights");
+ weights = MEM_mallocN(totvert * sizeof(float), "weights");
if (em) {
const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT);
@@ -1622,7 +1622,7 @@ void BKE_key_convert_from_lattice(Lattice *lt, KeyBlock *kb)
if (kb->data) MEM_freeN(kb->data);
- kb->data = MEM_callocN(lt->key->elemsize * tot, "kb->data");
+ kb->data = MEM_mallocN(lt->key->elemsize * tot, "kb->data");
kb->totelem = tot;
bp = lt->def;
@@ -1664,7 +1664,7 @@ void BKE_key_convert_from_curve(Curve *cu, KeyBlock *kb, ListBase *nurb)
if (kb->data) MEM_freeN(kb->data);
- kb->data = MEM_callocN(cu->key->elemsize * tot, "kb->data");
+ kb->data = MEM_mallocN(cu->key->elemsize * tot, "kb->data");
kb->totelem = tot;
nu = nurb->first;
@@ -1762,7 +1762,7 @@ void BKE_key_convert_from_mesh(Mesh *me, KeyBlock *kb)
if (kb->data) MEM_freeN(kb->data);
- kb->data = MEM_callocN(me->key->elemsize * me->totvert, "kb->data");
+ kb->data = MEM_mallocN(me->key->elemsize * me->totvert, "kb->data");
kb->totelem = me->totvert;
mvert = me->mvert;
@@ -1812,7 +1812,7 @@ float (*BKE_key_convert_to_vertcos(Object *ob, KeyBlock *kb))[3]
if (tot == 0) return NULL;
- vertCos = MEM_callocN(tot * sizeof(*vertCos), "BKE_key_convert_to_vertcos vertCos");
+ vertCos = MEM_mallocN(tot * sizeof(*vertCos), "BKE_key_convert_to_vertcos vertCos");
/* Copy coords to array */
co = (float *)vertCos;
@@ -1895,7 +1895,7 @@ void BKE_key_convert_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3])
return;
}
- fp = kb->data = MEM_callocN(tot * elemsize, "BKE_key_convert_to_vertcos vertCos");
+ fp = kb->data = MEM_mallocN(tot * elemsize, "BKE_key_convert_to_vertcos vertCos");
/* Copy coords to keyblock */