Merge pull request #73262 from chutchinson/bug/73201-immediate-mesh-create-outline-crash

Prevent crash in ImmediateMesh.create_outline
This commit is contained in:
Rémi Verschelde 2023-02-15 09:50:37 +01:00
commit 174925e55c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 0 deletions

View File

@ -526,6 +526,9 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
vc = indices.size();
ir = indices.ptrw();
has_indices = true;
} else {
// Ensure there are enough vertices to construct at least one triangle.
ERR_FAIL_COND_V(vertices.size() % 3 != 0, Ref<ArrayMesh>());
}
HashMap<Vector3, Vector3> normal_accum;