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>2021-06-23 17:33:19 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-06-23 17:37:35 +0300
commit354ecc2f1e3a23edb6987b59257a60239b6c68c7 (patch)
tree772a87006b88cc76ba895560808cbdb6838bac40
parent157081069d3bb758f4ac442780111e76bd9247f2 (diff)
Fix T89269: Memory corruption during extrusions of overlapping edges
The "extrude" operator with the "use_dissolve_ortho_edges" option assumed the edges were connected.
-rw-r--r--source/blender/bmesh/operators/bmo_extrude.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c
index 0a08b340e87..ffdce943d9f 100644
--- a/source/blender/bmesh/operators/bmo_extrude.c
+++ b/source/blender/bmesh/operators/bmo_extrude.c
@@ -459,8 +459,10 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
}
/* Allocate array to store possible vertices that will be dissolved. */
- int boundary_verts_len = BMO_slot_map_count(dupeop.slots_out, "boundary_map.out");
- dissolve_verts = MEM_mallocN((size_t)boundary_verts_len * sizeof(*dissolve_verts), __func__);
+ int boundary_edges_len = BMO_slot_map_count(dupeop.slots_out, "boundary_map.out");
+ /* We do not know the real number of boundary vertices. */
+ int boundary_verts_len_maybe = 2 * boundary_edges_len;
+ dissolve_verts = MEM_mallocN(boundary_verts_len_maybe * sizeof(*dissolve_verts), __func__);
}
BMO_slot_copy(&dupeop, slots_out, "geom.out", op, slots_out, "geom.out");