Fix #113993: Bevel cutoff intersection type crash

Own mistake in d47ceb53f8

The old calls to `BLI_array_staticdeclare` were deceptive. Because no
appends were done after declaration, to actually use the array, the
variables remained null. Effectively `nullptr` was always being passed
in here.

Pull Request: https://projects.blender.org/blender/blender/pulls/114049
This commit is contained in:
Jesse Yurkovich
2023-10-24 00:29:46 +02:00
committed by Jesse Yurkovich
parent 7254caa267
commit abb6e9471f

View File

@@ -5690,8 +5690,6 @@ static void bevel_build_cutoff(BevelParams *bp, BMesh *bm, BevVert *bv)
bndv = bv->vmesh->boundstart;
do {
int i = bndv->index;
Vector<BMEdge *, BM_DEFAULT_NGON_STACK_SIZE> bmedges;
Vector<BMFace *, BM_DEFAULT_NGON_STACK_SIZE> bmfaces;
/* Add the first corner vertex under this boundvert. */
face_bmverts[0] = mesh_vert(bv->vmesh, i, 1, 0)->v;
@@ -5725,26 +5723,22 @@ static void bevel_build_cutoff(BevelParams *bp, BMesh *bm, BevVert *bv)
bev_create_ngon(bm,
face_bmverts,
bp->seg + 2 + build_center_face,
bmfaces.data(),
nullptr,
bmedges.data(),
nullptr,
nullptr,
bp->mat_nr,
true);
} while ((bndv = bndv->next) != bv->vmesh->boundstart);
/* Create the bottom face if it should be built, reusing previous face_bmverts allocation. */
if (build_center_face) {
Vector<BMEdge *, BM_DEFAULT_NGON_STACK_SIZE> bmedges;
Vector<BMFace *, BM_DEFAULT_NGON_STACK_SIZE> bmfaces;
/* Add all of the corner vertices to this face. */
for (int i = 0; i < n_bndv; i++) {
/* Add verts from each cutoff face. */
face_bmverts[i] = mesh_vert(bv->vmesh, i, 1, 0)->v;
}
// BLI_array_append(bmfaces, repface);
bev_create_ngon(
bm, face_bmverts, n_bndv, bmfaces.data(), nullptr, bmedges.data(), bp->mat_nr, true);
bev_create_ngon(bm, face_bmverts, n_bndv, nullptr, nullptr, nullptr, bp->mat_nr, true);
}
}