diff options
author | Bastien Montagne <bastien@blender.org> | 2020-05-13 19:42:10 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-05-13 19:47:44 +0300 |
commit | 2b5e301ea4612c576a5934d1e1a79d5452f6792a (patch) | |
tree | 749f2ef8168d7436f91177108c08e286e7aa677d /source/blender/editors/mesh/editmesh_intersect.c | |
parent | c7f74863dde1a417e2742d3dadb4f5fd8bfc36af (diff) |
Fix T75574: Instant crash: averaging custom normals on model.
Fairly critical code mistake actually, since it uses malloca,
BLI_smallstack should *never* be declared inside a loop...
Also optimized handling of the `loop_weight` heapsimple, we can also
only create and use a single one for all edited objects...
Found two other operators potentially affected by same issue (split
normals, and weld edges into faces).
Diffstat (limited to 'source/blender/editors/mesh/editmesh_intersect.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_intersect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_intersect.c b/source/blender/editors/mesh/editmesh_intersect.c index 0c37a2604d9..fd7cc2733ec 100644 --- a/source/blender/editors/mesh/editmesh_intersect.c +++ b/source/blender/editors/mesh/editmesh_intersect.c @@ -704,6 +704,8 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op)) BMEdge *e; BMIter iter; + BLI_SMALLSTACK_DECLARE(loop_stack, BMLoop *); + ViewLayer *view_layer = CTX_data_view_layer(C); uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( @@ -717,8 +719,6 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op)) continue; } - BLI_SMALLSTACK_DECLARE(loop_stack, BMLoop *); - { BMVert *v; BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { |