From 390e2021d82393ad606dd546c0ff04b216d976b3 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 5 Mar 2018 16:33:22 +0300 Subject: [PATCH] Fix crash in Offset transformation --- src/SMESHUtils/SMESH_Offset.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index f571535f2..6f17aefca 100644 --- a/src/SMESHUtils/SMESH_Offset.cxx +++ b/src/SMESHUtils/SMESH_Offset.cxx @@ -40,7 +40,7 @@ namespace { - const size_t theMaxNbFaces = 256; // max number of faces sharing a node + const int theMaxNbFaces = 256; // max number of faces sharing a node typedef NCollection_DataMap< Standard_Address, const SMDS_MeshNode* > TNNMap; typedef NCollection_Map< SMESH_Link, SMESH_Link > TLinkMap; @@ -575,7 +575,7 @@ namespace TIDSortedElemSet elemSet, avoidSet; int iFace = 0; const SMDS_MeshElement* f; - for ( ; faceIt->more(); faceIt->next() ) + for ( ; faceIt->more() && iFace < theMaxNbFaces; faceIt->next() ) { avoidSet.insert( faces[ iFace ].myFace ); f = SMESH_MeshAlgos::FindFaceInSet( theNewNode, faces[ iFace ].myNode2.Node(), @@ -597,7 +597,7 @@ namespace faces[ iFace ].SetNodes( i0, i1 ); faces[ iFace ].SetNormal( theFaceNormals ); } - int nbFaces = Min( iFace + 1, (int)theMaxNbFaces ); + int nbFaces = iFace + 1; theNewPos.SetCoord( 0, 0, 0 ); gp_XYZ oldXYZ = SMESH_NodeXYZ( theNewNode ); -- 2.39.2