kwin/colorcorrection
Vlad Zahorodnii ab3d7d5277 [colorcorrection] Fix division by zero
Summary:
m_currentTemp can be equal to targetTemp when resetSlowUpdateTimer is
called. resetSlowUpdateTimer doesn't handle that case, which results
in an FP exception being raised:

    ==20103==ERROR: AddressSanitizer: FPE on unknown address 0x7f40857d5ca6 (pc 0x7f40857d5ca6 bp 0x7ffccd95c330 sp 0x7ffccd95c220 T0)
        #0 0x7f40857d5ca5 in KWin::ColorCorrect::Manager::resetSlowUpdateTimer() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/colorcorrection/manager.cpp:417
        #1 0x7f40857d521d in KWin::ColorCorrect::Manager::resetSlowUpdateStartTimer() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/colorcorrection/manager.cpp:388
        #2 0x7f40857d42d5 in KWin::ColorCorrect::Manager::resetQuickAdjustTimer() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/colorcorrection/manager.cpp:324
        #3 0x7f40857d3ac1 in KWin::ColorCorrect::Manager::resetAllTimers() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/colorcorrection/manager.cpp:286
        #4 0x7f40857d0311 in KWin::ColorCorrect::Manager::hardReset() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/colorcorrection/manager.cpp:152
        #5 0x7f40857d038d in KWin::ColorCorrect::Manager::reparseConfigAndReset() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/colorcorrection/manager.cpp:159
        #6 0x420e75 in ColorCorrectNightColorTest::testConfigRead() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/autotests/integration/colorcorrect_nightcolor_test.cpp:126
        #7 0x4326b4 in ColorCorrectNightColorTest::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/build/autotests/integration/testColorCorrectNightColor_waylandonly_autogen/include/colorcorrect_nightcolor_test.moc:98
        #8 0x7f407a80a94a in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/usr/lib64/libQt5Core.so.5+0x29694a)
        #9 0x7f40840a8962  (/usr/lib64/libQt5Test.so.5+0x19962)
        #10 0x7f40840a9352  (/usr/lib64/libQt5Test.so.5+0x1a352)
        #11 0x7f40840a9910  (/usr/lib64/libQt5Test.so.5+0x1a910)
        #12 0x7f40840a9cda in QTest::qRun() (/usr/lib64/libQt5Test.so.5+0x1acda)
        #13 0x7f40840a9edb in QTest::qExec(QObject*, int, char**) (/usr/lib64/libQt5Test.so.5+0x1aedb)
        #14 0x432428 in main /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/autotests/integration/colorcorrect_nightcolor_test.cpp:338
        #15 0x7f407a095bca in __libc_start_main (/lib64/libc.so.6+0x26bca)
        #16 0x413ea9 in _start (/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/build/bin/testColorCorrectNightColor_waylandonly+0x413ea9)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23914
2019-09-13 10:48:21 +03:00
..
colorcorrect_settings.kcfg [colorcorrection] Add "Constant" mode 2019-07-22 00:30:39 +03:00
colorcorrect_settings.kcfgc [colorcorrection] Night Color - blue light filter at nighttime 2017-12-11 10:58:40 +01:00
colorcorrectdbusinterface.cpp [colorcorrection] Night Color - blue light filter at nighttime 2017-12-11 10:58:40 +01:00
colorcorrectdbusinterface.h Use more traditional doxygen style 2019-07-29 22:06:19 +03:00
constants.h Use more traditional doxygen style 2019-07-29 22:06:19 +03:00
manager.cpp [colorcorrection] Fix division by zero 2019-09-13 10:48:21 +03:00
manager.h Use more traditional doxygen style 2019-07-29 22:06:19 +03:00
suncalc.cpp Port away from deprecated headers 2019-07-09 23:59:07 +03:00
suncalc.h Use more traditional doxygen style 2019-07-29 22:06:19 +03:00