diff --git a/src/osgPlugins/ac3d/ac3d.cpp b/src/osgPlugins/ac3d/ac3d.cpp index 98f3f6102..bec58b1c1 100644 --- a/src/osgPlugins/ac3d/ac3d.cpp +++ b/src/osgPlugins/ac3d/ac3d.cpp @@ -4,7 +4,6 @@ // eg the basic parsing of an AC3D file. // Conversion from AC3D scenegraph to OSG by GW Michel. -#include #include #include @@ -570,8 +569,11 @@ public: VertexIndex addRefData(unsigned i, const RefData& refData) { - // must be checked outside - assert(i < _vertices.size()); + if (_vertices.size() <= i) + { + osg::notify(osg::FATAL) << "osgDB ac3d reader: internal error, got invalid vertex index!" << std::endl; + return VertexIndex(0, 0); + } _dirty = true; return VertexIndex(i, _vertices[i].addRefData(refData)); }