[PATCH 6/9] compositor: check wlsc_surface::link before accessing neighbors

Pekka Paalanen ppaalanen at gmail.com
Tue Nov 15 03:34:53 PST 2011


Check that wlsc_surface::link is part of a list before assuming it is
part of the compositor->surface_list list.

The shell plugin may want to remove a surface from the compositor's
surface list to hide it. Note, that the shell plugin cannot use
wlsc_surface::link for its own purposes.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 compositor/compositor.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/compositor/compositor.c b/compositor/compositor.c
index 9078af7..e8bab91 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -312,6 +312,9 @@ wlsc_surface_damage_below(struct wlsc_surface *surface)
 {
 	struct wlsc_surface *below;
 
+	if (wl_list_empty(&surface->link))
+		return;
+
 	if (surface->link.next == &surface->compositor->surface_list)
 		return;
 
-- 
1.7.3.4



More information about the wayland-devel mailing list