aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/mesh.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/mesh.cpp b/src/client/mesh.cpp
index 9bbb3a0a8..bec72fb5e 100644
--- a/src/client/mesh.cpp
+++ b/src/client/mesh.cpp
@@ -348,7 +348,7 @@ bool checkMeshNormals(scene::IMesh *mesh)
if (!std::isfinite(length) || length < 1e-10f)
return false;
- const u16 count = MYMIN(MAX_FACES_TO_CHECK * 3, buffer->getIndexCount());
+ const u16 count = MYMIN(MAX_FACES_TO_CHECK * 3, buffer->getIndexCount() - 3);
for (u16 i = 0; i < count; i += 3) {
core::plane3df plane(buffer->getPosition(buffer->getIndices()[i]),