From e2961502ad666b76e835612a5c9e8ad49f87e7d1 Mon Sep 17 00:00:00 2001 From: monsta Date: Sun, 2 Nov 2014 14:23:34 +0300 Subject: compositor: fix possible dereference of NULL pointer Closes https://github.com/mate-desktop/marco/pull/145 --- src/compositor/compositor-xrender.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/compositor') diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index 31b0be2c..7d31f303 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -1478,13 +1478,18 @@ add_damage (MetaScreen *screen, /* dump_xserver_region ("add_damage", display, damage); */ - if (info != NULL && info->all_damage) + if (info != NULL) { - XFixesUnionRegion (xdisplay, info->all_damage, info->all_damage, damage); - XFixesDestroyRegion (xdisplay, damage); + if (info->all_damage) + { + XFixesUnionRegion (xdisplay, info->all_damage, info->all_damage, damage); + XFixesDestroyRegion (xdisplay, damage); + } + else + { + info->all_damage = damage; + } } - else - info->all_damage = damage; #ifdef USE_IDLE_REPAINT add_repair (display); -- cgit v1.2.1