diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-12-12 14:55:28 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-12-12 14:59:51 +0300 |
commit | 85b7d397f7620b57ce4014ee7b0119eef64578d9 (patch) | |
tree | 88a72850a16310cfa5a502f6fbcab024deedddc0 | |
parent | ba5aedea8fef8f04884b38cf524b1bf34a7760f1 (diff) |
Fix T72380: New Weld Modifier is crashing when used after a Vertex Weight Modifier
It happened when the vertex group was empty.
-rw-r--r-- | source/blender/modifiers/intern/MOD_weld.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index ca6998b9aa4..ae081942a39 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -1645,6 +1645,14 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex BVHTree *bvhtree = bvhtree_from_mesh_verts_ex( &treedata, mvert, totvert, false, v_mask, v_mask_act, wmd->merge_dist, 2, 6, 0, NULL); + if (v_mask) { + MEM_freeN(v_mask); + } + + if (bvhtree == NULL) { + return result; + } + struct WeldOverlapData data; data.mvert = mvert; data.merge_dist_sq = SQUARE(wmd->merge_dist); @@ -1855,9 +1863,6 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex weld_mesh_context_free(&weld_mesh); } - if (v_mask) { - MEM_freeN(v_mask); - } MEM_freeN(overlap); return result; } |