[Bf-blender-cvs] [1c0230b5739] master: Fix for Fix (c) : Normals Edit modifier using unititialized array of normals...
Bastien Montagne
noreply at git.blender.org
Wed Feb 19 16:37:20 CET 2020
Commit: 1c0230b5739b9af5cf95019b590e64477389f134
Author: Bastien Montagne
Date: Wed Feb 19 16:35:45 2020 +0100
Branches: master
https://developer.blender.org/rB1c0230b5739b9af5cf95019b590e64477389f134
Fix for Fix (c) : Normals Edit modifier using unititialized array of normals...
Own mistake in recent rBcfdb5b9a8b07.
===================================================================
M source/blender/modifiers/intern/MOD_normal_edit.c
===================================================================
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;
}
More information about the Bf-blender-cvs
mailing list