From: Konstantin Leontev Date: Mon, 16 Oct 2023 15:08:16 +0000 (+0100) Subject: [bos #37951][EDF 25230] SIGSEGV with MakeVertexInsideFace. Added check for an uniniti... X-Git-Tag: V9_12_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=f7a34e70811b846a2878ed84d1c973dd935b82b3;p=modules%2Fgeom.git [bos #37951][EDF 25230] SIGSEGV with MakeVertexInsideFace. Added check for an uninitialized curve. --- diff --git a/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx b/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx index 505ec6a8f..511de81ac 100644 --- a/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx +++ b/src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx @@ -1292,6 +1292,13 @@ gp_Pnt GetMidPnt2d(const TopoDS_Face& theFace, const TopoDS_Edge& anEdge = aWexp.Current(); if (!aUsedEmap.Add(anEdge)) continue; BRepAdaptor_Curve2d aBAcurve2d (anEdge, theFace); + // Initialization of curve could fail in constructor, + // so we need to check if we actually have a curve here. + if (!aBAcurve2d.Curve()) + { + continue; + } + Standard_Real aDelta = (aBAcurve2d.LastParameter() - aBAcurve2d.FirstParameter())/aNbSamples; for (Standard_Integer ii = 0; ii < aNbSamples; ii++) {