Skip to content

Commit

Permalink
Fix crash when processing empty mesh buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Sep 24, 2023
1 parent ff87be6 commit 5109fa7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/mesh.cpp
Expand Up @@ -337,6 +337,8 @@ bool checkMeshNormals(scene::IMesh *mesh)

for (u32 i = 0; i < buffer_count; i++) {
scene::IMeshBuffer *buffer = mesh->getMeshBuffer(i);
if (!buffer->getVertexCount())
continue;

// Here we intentionally check only first normal, assuming that if buffer
// has it valid, then most likely all other ones are fine too. We can
Expand Down

0 comments on commit 5109fa7

Please sign in to comment.