Package: opencascade / 7.5.1+dfsg1-2

0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Subject: [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
From: blobfish <blobfish@gmx.com>

Date: Tue, 29 Sep 2020 06:41:32 -0400


---
 src/BRepFill/BRepFill_Filling.cxx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- a/src/BRepFill/BRepFill_Filling.cxx
+++ b/src/BRepFill/BRepFill_Filling.cxx
@@ -105,6 +105,7 @@
   while (!Edges.IsEmpty())
   {
     TopTools_ListIteratorOfListOfShape itl(Edges);
+    bool found = false;
     for (; itl.More(); itl.Next())
     {
       anEdge = TopoDS::Edge(itl.Value());
@@ -127,11 +128,17 @@
           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);