Sanity check to avoid dereferencing a null pointer.

* src/compositor.c (do_effect): Sanity check to avoid dereferencing
        a null pointer.
This commit is contained in:
Thomas James Alexander Thurman 2006-12-12 18:30:27 +00:00
parent 54b0105ffa
commit ea137d35f3
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-12-12 Thomas Thurman <thomas@thurman.org.uk>
* src/compositor.c (do_effect): Sanity check to avoid dereferencing
a null pointer.
2006-12-10 Thomas Thurman <thomas@thurman.org.uk> 2006-12-10 Thomas Thurman <thomas@thurman.org.uk>
* configure.in: post-release bump to 2.17.5. * configure.in: post-release bump to 2.17.5.

View File

@ -121,6 +121,15 @@ do_effect (MetaEffect *effect,
MetaCompWindow *window; MetaCompWindow *window;
screen = meta_comp_screen_get_by_xwindow (get_xid (effect->window)); screen = meta_comp_screen_get_by_xwindow (get_xid (effect->window));
if (!screen)
{
/* sanity check: if no screen is found, bail */
meta_warning ("No screen found for %s (%ld); aborting effect.\n",
effect->window->desc, get_xid (effect->window));
return;
}
window = meta_comp_screen_lookup_window (screen, get_xid (effect->window)); window = meta_comp_screen_lookup_window (screen, get_xid (effect->window));
switch (effect->type) switch (effect->type)