diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-02-19 18:35:45 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-02-19 18:35:45 +0300 |
commit | 1c0230b5739b9af5cf95019b590e64477389f134 (patch) | |
tree | 4a5aec2a05b5c505653f8deeacc9304470d13137 /source/blender/modifiers | |
parent | e317e9f6c75c238f4750db1bf80a9a3e8b2754f6 (diff) |
Fix for Fix (c) : Normals Edit modifier using unititialized array of normals...
Own mistake in recent rBcfdb5b9a8b07.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_normal_edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c index 4e84d9a5ec7..572d9505e4e 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.c +++ b/source/blender/modifiers/intern/MOD_normal_edit.c @@ -527,7 +527,6 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd, float(*polynors)[3]; CustomData *ldata = &result->ldata; - loopnors = MEM_malloc_arrayN((size_t)num_loops, sizeof(*loopnors), __func__); /* Compute poly (always needed) and vert normals. */ CustomData *pdata = &result->pdata; @@ -551,6 +550,7 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd, clnors = CustomData_get_layer(ldata, CD_CUSTOMLOOPNORMAL); if (use_current_clnors) { clnors = CustomData_duplicate_referenced_layer(ldata, CD_CUSTOMLOOPNORMAL, num_loops); + loopnors = MEM_malloc_arrayN((size_t)num_loops, sizeof(*loopnors), __func__); BKE_mesh_normals_loop_split(mvert, num_verts, @@ -624,7 +624,7 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd, /* Currently Modifier stack assumes there is no poly normal data passed around... */ CustomData_free_layers(pdata, CD_NORMAL, num_polys); - MEM_freeN(loopnors); + MEM_SAFE_FREE(loopnors); return result; } |