[4.3] ImporterMesh: Validate triangle indices array size is a mult of 3

This commit is contained in:
Aaron Franke
2025-08-16 01:33:16 -07:00
parent 301f749910
commit 79aefd4c0e
2 changed files with 15 additions and 6 deletions

View File

@@ -307,6 +307,7 @@ void ImporterMesh::generate_lods(float p_normal_merge_angle, float p_normal_spli
if (index_count == 0) {
continue; //no lods if no indices
}
ERR_FAIL_COND_MSG(index_count % 3 != 0, "ImporterMesh::generate_lods: Indexed triangle meshes MUST have an index array with a size that is a multiple of 3, but got " + itos(index_count) + " indices. Cannot generate LODs for this invalid mesh.");
const Vector3 *vertices_ptr = vertices.ptr();
const int *indices_ptr = indices.ptr();