From 2b5e301ea4612c576a5934d1e1a79d5452f6792a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 13 May 2020 18:42:10 +0200 Subject: 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). --- source/blender/editors/mesh/editmesh_intersect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_intersect.c') 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) { -- cgit v1.2.3