[cairo-commit] src/cairo-xlib-render-compositor.c

Bryce Harrington bryce at kemper.freedesktop.org
Mon Jul 6 14:14:27 PDT 2015


 src/cairo-xlib-render-compositor.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f6843d5cbb79c35f7b331ac31c4a55c9574928fc
Author: Arpit Jain <jain.arpit at samsung.com>
Date:   Mon Jul 6 14:13:06 2015 -0700

    xlib: Fix deferencing of uninitialised 'display'
    
    Initialising 'display' to NULL and checking before deferencing during display->base.
    This patch will check the deferencing of uninitialised 'display' in case,
    _cairo_xlib_display_acquire does not return CAIRO_STATUS_SUCCESS.
    
    Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=87893
    Signed-off-by: Arpit Jain <jain.arpit at samsung.com>
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c
index 8a1ec7b..055780d 100644
--- a/src/cairo-xlib-render-compositor.c
+++ b/src/cairo-xlib-render-compositor.c
@@ -958,7 +958,7 @@ _cairo_xlib_font_fini (cairo_scaled_font_private_t *abstract_private,
 {
     cairo_xlib_font_t *priv = (cairo_xlib_font_t *) abstract_private;
     cairo_status_t status;
-    cairo_xlib_display_t *display;
+    cairo_xlib_display_t *display = NULL;
     int i;
 
     cairo_list_del (&priv->base.link);
@@ -978,7 +978,11 @@ _cairo_xlib_font_fini (cairo_scaled_font_private_t *abstract_private,
 
     cairo_device_release (&display->base);
 BAIL:
-    cairo_device_destroy (&display->base);
+    if(display)
+	cairo_device_destroy (&display->base);
+    else
+	cairo_device_destroy (priv->device);
+	
     free (priv);
 }
 


More information about the cairo-commit mailing list