diff --git a/src/osgPlugins/gles/GeometrySplitterVisitor b/src/osgPlugins/gles/GeometrySplitterVisitor index da7ce1b5f..321252435 100644 --- a/src/osgPlugins/gles/GeometrySplitterVisitor +++ b/src/osgPlugins/gles/GeometrySplitterVisitor @@ -215,11 +215,14 @@ protected: if (!primitivesToFix.empty()) { // filter all indices > _maxIndexValue in primitives for (unsigned int i = 0; i < primitivesToFix.size(); i++) { - osg::DrawElements* source = primitivesToFix[i].get(); - osg::DrawElements* large = removeLargeIndices(dynamic_cast(source)); - reportedPrimitives.push_back(large); - geomPrimitives.push_back(source); - setValidIndices(validIndices, source); + osg::DrawElementsUInt* source = dynamic_cast(primitivesToFix[i].get()); + if (source) + { + osg::DrawElements* large = removeLargeIndices(source); + reportedPrimitives.push_back(large); + geomPrimitives.push_back(source); + setValidIndices(validIndices, source); + } } }