From: blobfish Date: Tue, 23 May 2023 07:45:56 +0000 (+0100) Subject: [PATCH 3/7] BRepFill_Filling: WireFromList: We can't assume that a connected edge... X-Git-Tag: archive/raspbian/7.6.3+dfsg1-7+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=68cdbc387c2ee8c93e63ea7b9aa524c99373a121;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 546919e9a..9342a9dde 100644 --- a/src/BRepFill/BRepFill_Filling.cxx +++ b/src/BRepFill/BRepFill_Filling.cxx @@ -104,6 +104,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()); @@ -126,11 +127,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);