]> OCCT Git - occt.git/commitdiff
SALOME_37951_SIGSEGV_MakeVertexInsideFace Fixed exceptions with loading null curve...
authorjfa <jfa@opencascade.com>
Tue, 17 Oct 2023 09:06:58 +0000 (10:06 +0100)
committerjfa <jfa@opencascade.com>
Thu, 4 Jan 2024 18:24:47 +0000 (18:24 +0000)
src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx

index b1a938bc32be7fd5ec51ae6ba51d8f4fdbe605bf..2dda6072736eab95d45641cac4b5dac291d17eb7 100644 (file)
@@ -76,7 +76,10 @@ void  BRepAdaptor_Curve2d::Initialize(const TopoDS_Edge& E,
   myFace = F;
   Standard_Real pf,pl;
   const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E,F,pf,pl);
-  Geom2dAdaptor_Curve::Load(PC,pf,pl);
+  if (PC)
+  {
+    Geom2dAdaptor_Curve::Load(PC,pf,pl);
+  }
 }
 
 //=======================================================================
index 6c80bf964d4617a47fcf96fb7ceb55de4f18bde7..d68e3227f86045005351f78ecaa6ba7dc270a4b3 100644 (file)
@@ -442,8 +442,10 @@ static Standard_Boolean FindCoordBounds(const TopTools_SequenceOfShape& theFaces
 
   if (aPairSeq.Length() == 2)
     theMinCoord = aPairSeq(2).first - thePeriod;
-  else
+  else if (aPairSeq.Length() > 0)
     theMinCoord = aPairSeq(1).first;
+  else
+    return Standard_False;
 
   theMaxCoord = aPairSeq(1).second;
   return Standard_True;