From 8a6bad9c59f70a666df3d951deb20715585a1cce Mon Sep 17 00:00:00 2001 From: frohlich Date: Sat, 23 May 2009 12:02:23 +0000 Subject: [PATCH] Avoid division by zero. Modified Files: src/Instrumentation/inst_vertical_speed_indicator.cxx --- src/Instrumentation/inst_vertical_speed_indicator.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/inst_vertical_speed_indicator.cxx b/src/Instrumentation/inst_vertical_speed_indicator.cxx index fd339b481..0237a6ded 100644 --- a/src/Instrumentation/inst_vertical_speed_indicator.cxx +++ b/src/Instrumentation/inst_vertical_speed_indicator.cxx @@ -20,6 +20,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // +#include #include #include "inst_vertical_speed_indicator.hxx" @@ -191,7 +192,7 @@ void InstVerticalSpeedIndicator::update (double dt) if (_serviceable_node->getBoolValue()) { // avoids hang, when freeze - if( !_freeze_node->getBoolValue() ) + if( !_freeze_node->getBoolValue() && std::numeric_limits::min() < fabs(dt)) { double pressure_inhg = _pressure_node->getDoubleValue(); double sea_inhg = _sea_node->getDoubleValue(); -- 2.39.5