[PATCH xserver] animcur: Fix crash when removing a master device

Adam Jackson ajax at redhat.com
Mon Apr 23 19:21:14 UTC 2018


Reproducer:

$ Xvfb -ac -noreset :1 &
$ DISPLAY=:1 xinput create-master touch1
$ DISPLAY=:1 xinput remove-master "touch1 pointer"

Bugzilla: https://bugs.freedesktop.org/105761
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 render/animcur.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/render/animcur.c b/render/animcur.c
index 65327df655..ef27bda278 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -155,7 +155,8 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
 static void
 AnimCurCancelTimer(DeviceIntPtr pDev)
 {
-    CursorPtr cur = pDev->spriteInfo->sprite->current;
+    CursorPtr cur = pDev->spriteInfo->sprite ?
+                    pDev->spriteInfo->sprite->current : NULL;
 
     if (IsAnimCur(cur))
         TimerCancel(GetAnimCur(cur)->timer);
-- 
2.17.0



More information about the xorg-devel mailing list