From df49f1bc1bfa4495ddb5a94968ce036693d259a6 Mon Sep 17 00:00:00 2001 From: hlg Date: Thu, 14 Feb 2019 03:16:03 +0800 Subject: [PATCH] prevent index out of bound in case of a single point --- src/ifcgeom/IfcGeomWires.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomWires.cpp b/src/ifcgeom/IfcGeomWires.cpp index 7c1a93a7f0..46e9e72117 100644 --- a/src/ifcgeom/IfcGeomWires.cpp +++ b/src/ifcgeom/IfcGeomWires.cpp @@ -912,7 +912,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + IfcSchema::Type::ToString(segment->type())); } } - } else { + } else if (points.begin() < points.end()) { std::vector::const_iterator previous = points.begin(); for (std::vector::const_iterator current = previous+1; current < points.end(); ++current){ w.Add(BRepBuilderAPI_MakeEdge(*previous, *current));