diff options
author | Morten Johan Sørvig <msorvig@gmail.com> | 2019-08-07 13:15:51 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-08-11 12:01:26 +0200 |
commit | 5d7f1133205d14002463456c26a97f8ba17d69b8 (patch) | |
tree | 7497200a5b145784799969855de7096b79d9f0d5 /src | |
parent | a08ac1986d39b4d4614f654b3408c7b846c835c9 (diff) |
Add nullptr guard to QHighDScaling::scaleAndOrigin(QPlatformScreen *)
Commit b6ded193 added an unconditional dereference
of the platformScreen pointer, for calls where nativePostion
is non-nullptr.
Change-Id: I4a6fbbd0337f91d4fcb76c17b4dc60e1b9ad10ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qhighdpiscaling.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 0fea416404..64f1397771 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -456,6 +456,8 @@ QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QPlatformS { if (!m_active) return { qreal(1), QPoint() }; + if (!platformScreen) + return { m_factor, QPoint() }; // the global factor const QPlatformScreen *actualScreen = nativePosition ? platformScreen->screenForPosition(*nativePosition) : platformScreen; return { m_factor * screenSubfactor(actualScreen), actualScreen->geometry().topLeft() }; |