mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 17:35:37 +02:00
Fix crash when processing empty mesh buffers
This commit is contained in:
@@ -337,6 +337,8 @@ bool checkMeshNormals(scene::IMesh *mesh)
|
|||||||
|
|
||||||
for (u32 i = 0; i < buffer_count; i++) {
|
for (u32 i = 0; i < buffer_count; i++) {
|
||||||
scene::IMeshBuffer *buffer = mesh->getMeshBuffer(i);
|
scene::IMeshBuffer *buffer = mesh->getMeshBuffer(i);
|
||||||
|
if (!buffer->getVertexCount())
|
||||||
|
continue;
|
||||||
|
|
||||||
// Here we intentionally check only first normal, assuming that if buffer
|
// 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
|
// has it valid, then most likely all other ones are fine too. We can
|
||||||
|
Reference in New Issue
Block a user