Fix for Fix (c) : Normals Edit modifier using unititialized array of normals...

Own mistake in recent rBcfdb5b9a8b07.
This commit is contained in:
Bastien Montagne 2020-02-19 16:35:45 +01:00
parent e317e9f6c7
commit 1c0230b573
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}