From 5109fa7edaf95982cadfc15da284f494c0fa83bf Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 22 Sep 2023 21:29:10 +0200 Subject: [PATCH] Fix crash when processing empty mesh buffers --- src/client/mesh.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/mesh.cpp b/src/client/mesh.cpp index b2cab4faa..7fff2b314 100644 --- a/src/client/mesh.cpp +++ b/src/client/mesh.cpp @@ -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