From e97db243cc374bf9acafe742ce2043a35c8bfa1b Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 13 Apr 2006 09:58:01 +0000 Subject: [PATCH] prevent SIGFPE in SetParametersByMesh() when there are no edges in submesh --- src/StdMeshers/StdMeshers_AutomaticLength.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.cxx b/src/StdMeshers/StdMeshers_AutomaticLength.cxx index fa74a7dc5..551843523 100644 --- a/src/StdMeshers/StdMeshers_AutomaticLength.cxx +++ b/src/StdMeshers/StdMeshers_AutomaticLength.cxx @@ -300,7 +300,10 @@ bool StdMeshers_AutomaticLength::SetParametersByMesh(const SMESH_Mesh* theMesh SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge ); if ( !eSubMesh ) return false; - double segLen = L / eSubMesh->NbElements(); + int nbSeg = eSubMesh->NbElements(); + if ( nbSeg < 1 ) + continue; + double segLen = L / nbSeg; // get segment length from _TShapeToLength map::iterator tshape_length = -- 2.39.2