1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 15:09:39 +00:00

Fix UB when pathgrid geometry is generated and all pathgrid edges are invalid

This commit is contained in:
Alexei Kotov 2025-02-16 17:46:52 +03:00
parent 3b05ec0ab1
commit 602a429a68

View file

@ -126,9 +126,9 @@ namespace SceneUtil
gridGeometry->setVertexArray(vertices);
gridGeometry->setColorArray(colors, osg::Array::BIND_PER_VERTEX);
if (pointIndexCount)
if (!pointIndices->empty())
gridGeometry->addPrimitiveSet(pointIndices);
if (edgeIndexCount)
if (!lineIndices->empty())
gridGeometry->addPrimitiveSet(lineIndices);
gridGeometry->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
}