From aab30e9a3ec78c3a9b2998feeef275e973ef0ff2 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 12 Apr 2010 12:12:01 +0200 Subject: Safeguard ourselves against corrupt registry values for cleartype gamma Reviewed-by: Eskil Task: http://bugreports.qt.nokia.com/browse/QTBUG-7596 --- src/gui/painting/qdrawhelper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index b1e3281..a0c9828 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6983,6 +6983,11 @@ void qt_build_pow_tables() { int winSmooth; if (SystemParametersInfo(0x200C /* SPI_GETFONTSMOOTHINGCONTRAST */, 0, &winSmooth, 0)) smoothing = winSmooth / 1000.0; + + // Safeguard ourselves against corrupt registry values... + if (smoothing > 5 || smoothing < 1) + smoothing = 1.4; + #endif #ifdef Q_WS_X11 -- cgit v0.12