diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 5a8f498457..bf0badfc1d 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -1006,6 +1006,9 @@ void mpScaleXLog::recalculateTicks( wxDC& dc, mpWindow& w ) { step *= 10.0; visibleDecades = log( maxVvis / minVvis ) / log( step ); + + if( !std::isfinite( visibleDecades ) ) + break; } for( d = minDecade; d<=maxDecade; d *= step )