From 1f435cc1fcb69cf0f6b195a986b5dd240026f620 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Sat, 24 May 2008 11:00:17 +0000 Subject: [PATCH] Check the compositor isn't NULL before dereferencing it. Fixes #534569 2008-05-24 Iain Holmes * 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 --- ChangeLog | 6 ++++++ src/compositor/compositor.c | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c44d483db..c69bcf38b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-24 Iain Holmes + + * src/compositor/compositor.c: Check the compositor isn't NULL before + dereferencing it. Fixes #534569 + (meta_compositor_get_window_pixmap): Actually return a value + 2008-05-19 Iain Holmes * src/core/window.c: Applied patch from Ed Catmur to fix #528787 diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 5cfc99e12..975bf341c 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -21,6 +21,7 @@ #include #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 }