1
0
forked from mirrors/0ad

Adds more checks for vertex and index buffer creations.

This was SVN commit r26502.
This commit is contained in:
vladislavbelov
2022-02-27 20:21:07 +00:00
parent 10c0d813bf
commit 1ff3b45a1e
4 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -304,7 +304,11 @@ void CTexturedLineRData::Update(const SOverlayTexturedLine& line)
indices.insert(indices.end(), capIndices.begin(), capIndices.end());
}
ENSURE(indices.size() % 3 == 0); // GL_TRIANGLES indices, so must be multiple of 3
if (vertices.empty() || indices.empty())
return;
// Indices for triangles, so must be multiple of 3.
ENSURE(indices.size() % 3 == 0);
m_BoundingBox = CBoundingBoxAligned();
for (const SVertex& vertex : vertices)