From 4f9f3d8c7703b5acc12ccb4d2c22271ea8964be5 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 13 Apr 2006 07:17:06 +0000 Subject: [PATCH] prevent SIGFPE with "Scale distribution" and "nb segments = 1" --- src/StdMeshers/StdMeshers_Regular_1D.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 5390c0428..28ddd2bdd 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -368,11 +368,14 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge else { // Number Of Segments hypothesis + int NbSegm = _ivalue[ NB_SEGMENTS_IND ]; + if ( NbSegm < 1 ) return false; + if ( NbSegm == 1 ) return true; + switch (_ivalue[ DISTR_TYPE_IND ]) { case StdMeshers_NumberOfSegments::DT_Scale: { - int NbSegm = _ivalue[ NB_SEGMENTS_IND ]; double scale = _value[ SCALE_FACTOR_IND ]; if (fabs(scale - 1.0) < Precision::Confusion()) { -- 2.39.2