The attached patch fixes a segfault in the VRML2 plugin
which is caused by Shape entities with empty vertex
lists.

- Cirilo
=== modified file 'plugins/3d/vrml/v2/vrml2_shape.cpp'
--- plugins/3d/vrml/v2/vrml2_shape.cpp	2016-02-23 02:31:51 +0000
+++ plugins/3d/vrml/v2/vrml2_shape.cpp	2016-05-20 00:47:27 +0000
@@ -476,6 +476,15 @@
 
     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 )

_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to