compositor: check wlsc_surface::link before accessing neighbors

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@gmail.com>
This commit is contained in:
Pekka Paalanen 2011-11-15 13:34:53 +02:00 committed by Kristian Høgsberg
parent ebc598ebf0
commit d503a0b318
1 changed files with 3 additions and 0 deletions

View File

@ -313,6 +313,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;