From 1b02ff98338d5bf865ec6d2037b4760a51b33f8a Mon Sep 17 00:00:00 2001 From: hujianwei Date: Thu, 17 Nov 2022 06:18:50 +0000 Subject: [PATCH] Fix crash trying to update seat cursor outputs * seat.c (UpdateCursorOutput): Do not update if the surface has been destroyed. --- seat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/seat.c b/seat.c index e511596..2891900 100644 --- a/seat.c +++ b/seat.c @@ -885,6 +885,11 @@ UpdateCursorOutput (SeatCursor *cursor, int root_x, int root_y) { int hotspot_x, hotspot_y; + if (!cursor->role.surface) + /* The surface has been destroyed, so there is no point in + continuing. */ + return; + /* Scale the hotspot coordinates up by the scale factor specified in the surface. */ hotspot_x = cursor->hotspot_x * cursor->role.surface->factor;