]> OCCT Git - occt.git/commitdiff
0033446: Modeling Alghorithms - Creating offset with one of the degenerated edge... CR0-WEEK-34 IR-2023-08-25
authorakaftasev <akaftasev@opencascade.com>
Tue, 8 Aug 2023 11:52:12 +0000 (12:52 +0100)
committervglukhik <vglukhik@opencascade.com>
Thu, 24 Aug 2023 14:11:57 +0000 (15:11 +0100)
Added condition to prevent out of range error

src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx

index f58c934dddbaf3bfd7ebde838cc98fc9866b33ad..fcbdd4ba7692c9f170770f836e3d8da9104614cb 100644 (file)
@@ -1292,6 +1292,10 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S)
     for (; itl.More(); itl.Next())
     {
       Standard_Integer IndOfFace = itl.Value();
+      if (AllFaces.Size() < IndOfFace)
+      {
+        continue;
+      }
       myGenerated.Append(AllFaces(IndOfFace));
     }
 
@@ -1302,6 +1306,10 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S)
         {
           Standard_Integer IndOfFace = itl.Value();
           IndOfFace += (i-1)*myNbEdgesInSection;
+          if (AllFaces.Size() < IndOfFace)
+          {
+            continue;
+          }
           myGenerated.Append(AllFaces(IndOfFace));
         }
   }