Skip to content

Commit 6ede563

Browse files
committed
Merge branch 'edgelord' into 'master'
Fix UB when pathgrid geometry is generated and all pathgrid edges are invalid See merge request OpenMW/openmw!4541
2 parents 3b05ec0 + 602a429 commit 6ede563

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/sceneutil/pathgridutil.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ namespace SceneUtil
126126

127127
gridGeometry->setVertexArray(vertices);
128128
gridGeometry->setColorArray(colors, osg::Array::BIND_PER_VERTEX);
129-
if (pointIndexCount)
129+
if (!pointIndices->empty())
130130
gridGeometry->addPrimitiveSet(pointIndices);
131-
if (edgeIndexCount)
131+
if (!lineIndices->empty())
132132
gridGeometry->addPrimitiveSet(lineIndices);
133133
gridGeometry->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
134134
}

0 commit comments

Comments
 (0)