From: blobfish Date: Tue, 29 Sep 2020 10:41:32 +0000 (-0400) Subject: [PATCH 3/7] BRepFill_Filling: WireFromList: We can't assume that a connected edge... X-Git-Tag: archive/raspbian/7.5.0+dfsg1-4+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=061a3b8a3e337ebed9e3af47aa4ebc7f78bf28d7;p=opencascade.git [PATCH 3/7] BRepFill_Filling: WireFromList: We can't assume that a connected edge was found and the iterator is valid or we will crash on Edges.Remove Gbp-Pq: Name 0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch --- diff --git a/src/BRepFill/BRepFill_Filling.cxx b/src/BRepFill/BRepFill_Filling.cxx index d45e19c3f..1d665682e 100644 --- a/src/BRepFill/BRepFill_Filling.cxx +++ b/src/BRepFill/BRepFill_Filling.cxx @@ -105,6 +105,7 @@ static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges) while (!Edges.IsEmpty()) { TopTools_ListIteratorOfListOfShape itl(Edges); + bool found = false; for (; itl.More(); itl.Next()) { anEdge = TopoDS::Edge(itl.Value()); @@ -127,11 +128,17 @@ static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges) anEdge.Reverse(); V2 = V3; } + found = true; break; } } - BB.Add(aWire, anEdge); - Edges.Remove(itl); + if (found) + { + BB.Add(aWire, anEdge); + Edges.Remove(itl); + } + else + break; } aWire.Closed(Standard_True);