summaryrefslogtreecommitdiff
path: root/src/compositor
diff options
context:
space:
mode:
authorIain Holmes <iain@gnome.org>2008-05-24 11:00:17 +0000
committerIain Holmes <iain@src.gnome.org>2008-05-24 11:00:17 +0000
commit1f435cc1fcb69cf0f6b195a986b5dd240026f620 (patch)
treec05b43694652f9c43014994c660fae9607d05f6b /src/compositor
parenta5d2bdea554c4d79119076dfad36e66386c49fb8 (diff)
downloadmetacity-1f435cc1fcb69cf0f6b195a986b5dd240026f620.tar.gz
metacity-1f435cc1fcb69cf0f6b195a986b5dd240026f620.tar.bz2
Check the compositor isn't NULL before dereferencing it. Fixes #534569
2008-05-24 Iain Holmes <iain@gnome.org> * src/compositor/compositor.c: Check the compositor isn't NULL before dereferencing it. Fixes #534569 (meta_compositor_get_window_pixmap): Actually return a value svn path=/trunk/; revision=3723
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 5cfc99e..975bf34 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -21,6 +21,7 @@
#include <config.h>
#include "compositor-private.h"
+#include "compositor-xrender.h"
MetaCompositor *
meta_compositor_new (MetaDisplay *display)
@@ -37,7 +38,7 @@ void
meta_compositor_destroy (MetaCompositor *compositor)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->destroy)
+ if (compositor && compositor->destroy)
compositor->destroy (compositor);
#endif
}
@@ -49,7 +50,7 @@ meta_compositor_add_window (MetaCompositor *compositor,
XWindowAttributes *attrs)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->add_window)
+ if (compositor && compositor->add_window)
compositor->add_window (compositor, window, xwindow, attrs);
#endif
}
@@ -59,7 +60,7 @@ meta_compositor_remove_window (MetaCompositor *compositor,
Window xwindow)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->remove_window)
+ if (compositor && compositor->remove_window)
compositor->remove_window (compositor, xwindow);
#endif
}
@@ -69,7 +70,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
MetaScreen *screen)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->manage_screen)
+ if (compositor && compositor->manage_screen)
compositor->manage_screen (compositor, screen);
#endif
}
@@ -79,7 +80,7 @@ meta_compositor_unmanage_screen (MetaCompositor *compositor,
MetaScreen *screen)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->unmanage_screen)
+ if (compositor && compositor->unmanage_screen)
compositor->unmanage_screen (compositor, screen);
#endif
}
@@ -90,7 +91,7 @@ meta_compositor_set_updates (MetaCompositor *compositor,
gboolean updates)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->set_updates)
+ if (compositor && compositor->set_updates)
compositor->set_updates (compositor, window, updates);
#endif
}
@@ -101,7 +102,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->process_event)
+ if (compositor && compositor->process_event)
compositor->process_event (compositor, event, window);
#endif
}
@@ -111,8 +112,8 @@ meta_compositor_get_window_pixmap (MetaCompositor *compositor,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->get_window_pixmap)
- compositor->get_window_pixmap (compositor, window);
+ if (compositor && compositor->get_window_pixmap)
+ return compositor->get_window_pixmap (compositor, window);
else
return None;
#else
@@ -126,7 +127,7 @@ meta_compositor_set_active_window (MetaCompositor *compositor,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- if (compositor->set_active_window)
+ if (compositor && compositor->set_active_window)
compositor->set_active_window (compositor, screen, window);
#endif
}