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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-10-13 02:01:42 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-10-13 02:29:15 +0300
commit8335c26119bf5ba78b2afa4e2f65bb3d04b42abe (patch)
tree385da65ad847c12f41a184cce333c6b16055ea6e /source/blender/modifiers/intern/MOD_weld.c
parent8427e02abc5e7963cee14e15bc9a1c78c95d28e6 (diff)
Fix T81467: Crash with KD-Tree Weld Modifier
The problem is related to the `use_index_order` option of `BLI_kdtree_3d_calc_duplicates_fast`. With this option, the higher index is expected to be less than `tree->nodes_len`.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weld.c')
-rw-r--r--source/blender/modifiers/intern/MOD_weld.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c
index 306e093919a..1a25c24fedc 100644
--- a/source/blender/modifiers/intern/MOD_weld.c
+++ b/source/blender/modifiers/intern/MOD_weld.c
@@ -1687,9 +1687,9 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex
}
#else
{
- KDTree_3d *tree = BLI_kdtree_3d_new(totvert);
+ KDTree_3d *tree = BLI_kdtree_3d_new(v_mask ? v_mask_act : totvert);
for (uint i = 0; i < totvert; i++) {
- if (!(v_mask && !BLI_BITMAP_TEST(v_mask, i))) {
+ if (!v_mask || BLI_BITMAP_TEST(v_mask, i)) {
BLI_kdtree_3d_insert(tree, i, mvert[i].co);
}
vert_dest_map[i] = OUT_OF_CONTEXT;
@@ -1697,7 +1697,7 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex
BLI_kdtree_3d_balance(tree);
vert_kill_len = BLI_kdtree_3d_calc_duplicates_fast(
- tree, wmd->merge_dist, true, (int *)vert_dest_map);
+ tree, wmd->merge_dist, false, (int *)vert_dest_map);
BLI_kdtree_3d_free(tree);
}
#endif