PATCH: segfault in VRML2 plugin

The attached patch fixes a segfault in the VRML2 plugin
which is caused by Shape entities with empty vertex
lists.
This commit is contained in:
Cirilo Bernardo 2016-05-19 21:12:07 -04:00 committed by Chris Pavlina
parent e2d4118470
commit 47e2aab7de
1 changed files with 9 additions and 0 deletions

View File

@ -476,6 +476,15 @@ SGNODE* WRL2SHAPE::TranslateToSG( SGNODE* aParent )
SGNODE* pShape = shNode.GetRawPtr();
SGNODE* pGeom = geometry->TranslateToSG( pShape );
if( NULL == pGeom )
{
// this can happen if a VRML file contains
// empty point or index sets
shNode.Destroy();
return NULL;
}
SGNODE* pApp = NULL;
if( NULL != appearance )