[mutter] wayland: avoid a crash in is_effectively_synchronized()
- From: Olivier Fourdan <ofourdan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland: avoid a crash in is_effectively_synchronized()
- Date: Thu, 3 May 2018 09:42:44 +0000 (UTC)
commit 52fdd24467fa8d6f97bd5f9eb6d5509fa43436c6
Author: Olivier Fourdan <ofourdan redhat com>
Date: Thu May 3 09:17:24 2018 +0200
wayland: avoid a crash in is_effectively_synchronized()
To check if a subsurface is effectively synchronized, we walk the
subsurface hierarchy to look for a non-subsurface parent or a subsurface
being synchronized.
However, when client is closing, the parent surface might already be
gone, in which case we end up with a surface being NULL which causes a
NULL pointer dereference and a crash.
Check if the parent surface is NULL to avoid the crash, and consider
it's already synchronized if it is NULL to avoid further updates.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/124
src/wayland/meta-wayland-surface.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index c0cef357a..0142e1a3d 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -573,7 +573,10 @@ meta_wayland_surface_is_effectively_synchronized (MetaWaylandSurface *surface)
{
MetaWaylandSurface *parent = surface->sub.parent;
- return meta_wayland_surface_is_effectively_synchronized (parent);
+ if (parent)
+ return meta_wayland_surface_is_effectively_synchronized (parent);
+
+ return TRUE;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]