summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-02-19 13:30:17 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-02-19 13:30:17 +0800
commitdd9ba6de9f8c66ae23c3282fa935455c30f3bc41 (patch)
tree15016fd6b8865910d47725ee7df5bea0ac9b9761 /scene
parentc944c9e572e616c2f0eba1e392fd17ca030625ec (diff)
Fix crash when importing small GLTF mesh
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/importer_mesh.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/importer_mesh.cpp b/scene/resources/importer_mesh.cpp
index 92ab091b86..a27da11f8d 100644
--- a/scene/resources/importer_mesh.cpp
+++ b/scene/resources/importer_mesh.cpp
@@ -287,7 +287,7 @@ void ImporterMesh::generate_lods(float p_normal_merge_angle, float p_normal_spli
const int *indices_ptr = indices.ptr();
if (normals.is_empty()) {
- normals.resize(vertices.size());
+ normals.resize(index_count);
Vector3 *n_ptr = normals.ptrw();
for (unsigned int j = 0; j < index_count; j += 3) {
const Vector3 &v0 = vertices_ptr[indices_ptr[j + 0]];