Fix T89269: Memory corruption during extrusions of overlapping edges

The "extrude" operator with the "use_dissolve_ortho_edges" option assumed
the edges were connected.
This commit is contained in:
Germano Cavalcante 2021-06-23 11:33:19 -03:00
parent 157081069d
commit 354ecc2f1e
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #89269, Memory corruption during extrusions of overlapping edges (crashes 2.93 in one case)
1 changed files with 4 additions and 2 deletions

View File

@ -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");