summaryrefslogtreecommitdiff
path: root/src/compositor/compositor-xrender.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2014-11-02 14:23:34 +0300
committerStefano Karapetsas <[email protected]>2014-11-26 09:47:58 +0100
commite2961502ad666b76e835612a5c9e8ad49f87e7d1 (patch)
tree12b0e32c7d974a7dedb60ffa4a35361d32c0ff38 /src/compositor/compositor-xrender.c
parent10e21cca0552688d8abf3e69de265370558e40d1 (diff)
downloadmarco-e2961502ad666b76e835612a5c9e8ad49f87e7d1.tar.bz2
marco-e2961502ad666b76e835612a5c9e8ad49f87e7d1.tar.xz
compositor: fix possible dereference of NULL pointer
Closes https://github.com/mate-desktop/marco/pull/145
Diffstat (limited to 'src/compositor/compositor-xrender.c')
-rw-r--r--src/compositor/compositor-xrender.c15
1 files changed, 10 insertions, 5 deletions
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);