]> 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>
Tue, 17 Oct 2023 09:06:58 +0000 (10:06 +0100)
src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx

index 2d121bed413d7c833fe9a4978a4f9cc825318086..c5037658330c455fd920c95efe8b9f2d96e60904 100644 (file)
@@ -54,7 +54,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 a8a0b7f759ccd9a5cf169a7c1aecd085926ffa00..5b64dc90fe51a362d96d02c9089dd8ce6c4aaf61 100644 (file)
@@ -441,8 +441,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;