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:
@@ -836,7 +836,7 @@ WriterNodeVisitor::calcVertices(osg::Geode & geo)
|
|||||||
for (unsigned int i = 0; i < geo.getNumDrawables(); ++i)
|
for (unsigned int i = 0; i < geo.getNumDrawables(); ++i)
|
||||||
{
|
{
|
||||||
osg::Geometry *g = geo.getDrawable( i )->asGeometry();
|
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;
|
return numVertice;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user