Hi Marc,

I have review your changes and to aid readability have made a small
adjustment to use ==0 rather than the ! that you used.  The changes I have
checked into svn/trunk and OSG-3.2 is:

Index: src/osgUtil/MeshOptimizers.cpp
===================================================================
--- src/osgUtil/MeshOptimizers.cpp      (revision 14485)
+++ src/osgUtil/MeshOptimizers.cpp      (working copy)
@@ -975,7 +975,7 @@
 void VertexCacheMissVisitor::doGeometry(Geometry& geom)
 {
     Array* vertArray = geom.getVertexArray();
-    if (!vertArray)
+    if (!vertArray || vertArray->getNumElements()==0)
         return;
     Geometry::PrimitiveSetList& primSets = geom.getPrimitiveSetList();
     CacheRecorder recorder(_cacheSize);
@@ -1117,7 +1117,7 @@
 void VertexAccessOrderVisitor::optimizeOrder(Geometry& geom)
 {
     Array* vertArray = geom.getVertexArray();
-    if (!vertArray)
+    if (!vertArray || vertArray->getNumElements()==0)
         return;
     Geometry::PrimitiveSetList& primSets = geom.getPrimitiveSetList();
     VertexReorder vr(vertArray->getNumElements());


On 19 September 2014 09:48, Marc Helbling <[email protected]> wrote:

> Hi Robert,
>
> I'm submitting a small update in the mesh optimizers code.
> I've come across scenes that contains geometries with initialized but
> empty vertex arrays and primitives and that would make some optimizers
> crash.
>
> The submission therefore only contains a test on the size of the vertex
> array for the VertexCacheMissVisitor and the VertexAccessOrderVisitor
> visitors.
>
>
> Hope this is useful. Thank you!
> Cheers,
> Marc
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=61091#61091
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/meshoptimizers_582.cpp
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to