From Luc Frauciel, "In 3ds plugin, asGeometry() is used on a drawable but the resulting pointer is not tested for nullity.

It leads to a crash when writing osgText::Text or Shapes"
This commit is contained in:
Robert Osfield
2012-03-01 11:03:18 +00:00
parent 2c7b82b401
commit ac2be18fbc

View File

@@ -836,7 +836,7 @@ WriterNodeVisitor::calcVertices(osg::Geode & geo)
for (unsigned int i = 0; i < geo.getNumDrawables(); ++i)
{
osg::Geometry *g = geo.getDrawable( i )->asGeometry();
if (g->getVertexArray()) numVertice += g->getVertexArray()->getNumElements();
if (g!=NULL && g->getVertexArray()) numVertice += g->getVertexArray()->getNumElements();
}
return numVertice;
}