From 8eb3ece317b546887394c0aa55a45d3668a71d84 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 13 May 2010 08:16:24 +0000 Subject: [PATCH] Minor fix (to avoid SIGFPE during picking of Gauss Points presentation with null length scalar range) --- src/PIPELINE/VISU_GaussPointsPL.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 43887c4f..06c33ffc 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -678,6 +678,10 @@ VISU_GaussPointsPL vtkFloatingPointType* aScalarRange = GetScalarRange(); vtkFloatingPointType aDeltaScalarRange = aScalarRange[1] - aScalarRange[0]; + // to avoid FPE if the minimum is equal to maximum + if( aDeltaScalarRange < 1.0 / VTK_LARGE_FLOAT ) + return aMinSize; + return aMinSize + aDelta*(aVal - aScalarRange[0]) / aDeltaScalarRange; } -- 2.39.2