From fe3b66c044745f11fa2cd9d427ee3d257dc48f38 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 27 Sep 2024 16:30:20 +0500 Subject: [PATCH] Stop processing IfcIndexedPolyCurve with < 2 verts at mapping stage #5474 as they're invalid and would't be able to create a curve --- src/ifcgeom/mapping/IfcIndexedPolyCurve.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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(