diff options
author | Romain Pokrzywka <romain.pokrzywka@bluescape.com> | 2018-06-18 19:01:05 +0200 |
---|---|---|
committer | Romain Pokrzywka <romain.pokrzywka@gmail.com> | 2018-06-18 19:48:40 +0000 |
commit | d0acd26c37c7b98612308e47e635b792949d7210 (patch) | |
tree | 1c542bae3173b493893a4205322cf6eb58e906bf /src/platformsupport | |
parent | b6421f9dd0c01d6c274a2dbedd79ba19b43f28c8 (diff) |
Fix evdevtouch input plugin crash when the device can't be opened
If a device fails to open during the plugin startup, we exit the handler
constructor early and leave the d member as nullptr.
However the recently added m_handler->isFiltered() call after m_handler
is instantiated assumes that d is always valid, which triggers a crash
in the forementionned situation. Fix it to check for d's validity first.
This can occur when a device is connected then disconnected right after,
so that it's gone by the time we get the notification from udev.
Change-Id: Ia755868338f92b91c181be8557e06e087d70fcc6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 7b7649bc5c..f3cc160b3e 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -368,7 +368,7 @@ QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler() bool QEvdevTouchScreenHandler::isFiltered() const { - return d->m_filtered; + return d && d->m_filtered; } QTouchDevice *QEvdevTouchScreenHandler::touchDevice() const |