diff options
author | Steffen Kieß <kiess@ki4.de> | 2020-08-24 00:53:00 +0200 |
---|---|---|
committer | Steffen Kieß <kiess@ki4.de> | 2020-10-02 23:12:07 +0200 |
commit | 63bbbdc4b8dba7be5690065dc6a4ffa5a85b1b32 (patch) | |
tree | a5510dbcfefea879a303dc178b006f1445466f5d /src/gui/kernel | |
parent | f51e6552e361c0716f6301b4c5b03b12e8bfe0fe (diff) |
Ignore mouse events where globalPos contains NaN
A NaN value in globalPos can cause an endless recursion in
QGuiApplicationPrivate::processMouseEvent() when e->enhancedMouseEvent()
is true and this is not a move event.
When an event contains a NaN in globalPos, print a warning and ignore
the event.
Pick-to: 5.15
Fixes: QTBUG-86207
Change-Id: I8789e465921789569715e52c98193f91945ea982
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 627cf9dba1..2f9349bb55 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2153,6 +2153,11 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo bool mousePress = false; QPointF globalPoint = e->globalPos; + if (qIsNaN(e->globalPos.x()) || qIsNaN(e->globalPos.y())) { + qWarning("QGuiApplicationPrivate::processMouseEvent: Got NaN in mouse position"); + return; + } + if (e->enhancedMouseEvent()) { type = e->buttonType; button = e->button; |