-rw-r--r-- | core/launcher/screensaver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp index 45da9ed..088ed19 100644 --- a/core/launcher/screensaver.cpp +++ b/core/launcher/screensaver.cpp @@ -190,2 +190,4 @@ void OpieScreenSaver::setBacklight ( int bright ) } + if ( m_sensordata [LS_Steps] < 2 ) // sanity check to avoid SIGFPE + m_sensordata [LS_Steps] = 2; @@ -235,3 +237,3 @@ void OpieScreenSaver::timerEvent ( QTimerEvent * ) - int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; + int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 |