From: eap Date: Wed, 6 Oct 2010 08:42:50 +0000 (+0000) Subject: 0021021: EDF 1586 SMESH: Memory saturation when using start and end length X-Git-Tag: V5_1_5rc1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b17ca5935735662de315d949bca3d0aa682cf13f;p=modules%2Fsmesh.git 0021021: EDF 1586 SMESH: Memory saturation when using start and end length protect from too large segment lengths with geometric and arithmetic progression hypotheses --- diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 827399030..1cfd9bd2c 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -731,6 +731,9 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, double a1 = _value[ BEG_LENGTH_IND ]; double an = _value[ END_LENGTH_IND ]; double q = ( theLength - a1 ) / ( theLength - an ); + if ( q < theLength/1e6 || 1.01*theLength < a1 + an) + return error ( SMESH_Comment("Invalid segment lengths (")< numeric_limits::min() ? ( 1+( an-a1 )/q ) : ( 1+theLength/a1 ));