Salome HOME
0021480: EDF 2084 SMESH: SIGSEGV when validating Netgen3D hypothesis
[modules/smesh.git] / src / SMESHUtils / SMESH_OctreeNode.cxx
index f735011e6ea84b6a0bf94e64e0a705016def0008..ddaac892b388c01165f8178e68c4663b189219fb 100644 (file)
@@ -249,7 +249,9 @@ void SMESH_OctreeNode::FindCoincidentNodes (TIDSortedNodeSet& theSetOfNodes,
                                             const int maxLevel,
                                             const int maxNbNodes)
 {
-  SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel, maxNbNodes, theTolerance);
+  // VSR 14/10/2011: limit max number of the levels in order to avoid endless recursing
+  const int MAX_LEVEL = 10;
+  SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel < 0 ? MAX_LEVEL : maxLevel, maxNbNodes, theTolerance);
   theOctreeNode.FindCoincidentNodes (&theSetOfNodes, theTolerance, theGroupsOfNodes);
 }