diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-04-12 10:12:01 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-04-12 10:12:50 (GMT) |
commit | aab30e9a3ec78c3a9b2998feeef275e973ef0ff2 (patch) | |
tree | 7cff5958ebf622bf3f97eb6dfcb435d874357d98 /src/gui/painting | |
parent | f1c74441b17dde565a91ab596cc1b9a920c2ab41 (diff) | |
download | Qt-aab30e9a3ec78c3a9b2998feeef275e973ef0ff2.zip Qt-aab30e9a3ec78c3a9b2998feeef275e973ef0ff2.tar.gz Qt-aab30e9a3ec78c3a9b2998feeef275e973ef0ff2.tar.bz2 |
Safeguard ourselves against corrupt registry values for cleartype gamma
Reviewed-by: Eskil
Task: http://bugreports.qt.nokia.com/browse/QTBUG-7596
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 |