From: akaftasev Date: Tue, 8 Aug 2023 11:52:12 +0000 (+0100) Subject: 0033446: Modeling Alghorithms - Creating offset with one of the degenerated edge... X-Git-Tag: V7_8_0~30 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=0e97c80e6ab0422fdb1d0ba7c0fcd8d691d62494;p=occt.git 0033446: Modeling Alghorithms - Creating offset with one of the degenerated edge leads to crash Added condition to prevent out of range error --- diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index f58c934ddd..fcbdd4ba76 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -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)); } }