diff --git a/src/ifcgeom/mapping/IfcIndexedPolyCurve.cpp b/src/ifcgeom/mapping/IfcIndexedPolyCurve.cpp index f63725a997..24f574c80f 100644 --- a/src/ifcgeom/mapping/IfcIndexedPolyCurve.cpp +++ b/src/ifcgeom/mapping/IfcIndexedPolyCurve.cpp @@ -34,6 +34,10 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcIndexedPolyCurve* inst) { } std::vector points; + if (coordinates.size() < 2) { + throw IfcParse::IfcException("IfcIndexedPolyCurve has less than 2 points."); + } + points.reserve(coordinates.size()); for (auto& coords : coordinates) { points.push_back(taxonomy::make(