From: Pasukhin Dmitry Date: Fri, 14 Feb 2025 13:13:53 +0000 (+0100) Subject: Data Exchange - IGES Import Degenerated BSpline crash #368 X-Git-Tag: V7_9_0~11 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=67bd61d4d375b4e71199eb28269706b9a6664c60;p=occt.git Data Exchange - IGES Import Degenerated BSpline crash #368 Degenerated bspline leads to null dereference Fix BSpline curve check and improve exception handling in TransferBSplineCurve --- diff --git a/src/IGESToBRep/IGESToBRep_BasicCurve.cxx b/src/IGESToBRep/IGESToBRep_BasicCurve.cxx index 70aacdd371..e071bfc7d4 100644 --- a/src/IGESToBRep/IGESToBRep_BasicCurve.cxx +++ b/src/IGESToBRep/IGESToBRep_BasicCurve.cxx @@ -1130,9 +1130,11 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve( //: 5 BSplineC = new Geom_BSplineCurve(Poles, Weight, Knot, Mult, Degree); } - // sln 29.12.2001 OCC90 : If curve can not be created do nothing - if (!checkBSplineCurve(this, start, Knot, Weight)) + // If curve can not be created do nothing + if (Poles.Size() < 2 || !checkBSplineCurve(this, start, Knot, Weight)) + { return BSplineRes; + } { try @@ -1151,6 +1153,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve( anException.Print(std::cout); #endif (void)anException; + return BSplineRes; } }