raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d3c56d5c74bb4940cb8818cd5bf338818da61f95

commit d3c56d5c74bb4940cb8818cd5bf338818da61f95
Author: Julien Isorce <j.iso...@samsung.com>
Date:   Thu Aug 21 18:40:01 2014 +0900

    xlib: fix undefined behaviour when freeing colormap too early
    
    Summary:
    On Ubuntu 14.04 it makes a 32 bit depth window un-responsive
    to any XEvent.
    
    Reviewers: cedric, raster
    
    Reviewed By: raster
    
    Subscribers: raster, capOM, cedric
    
    Differential Revision: https://phab.enlightenment.org/D1236
---
 src/lib/ecore_x/xlib/ecore_x_window.c                    | 1 -
 src/modules/evas/engines/software_x11/evas_xlib_outbuf.c | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_x/xlib/ecore_x_window.c 
b/src/lib/ecore_x/xlib/ecore_x_window.c
index 4384054..2fac34a 100644
--- a/src/lib/ecore_x/xlib/ecore_x_window.c
+++ b/src/lib/ecore_x/xlib/ecore_x_window.c
@@ -1683,7 +1683,6 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
                        CWWinGravity,
                        &attr);
    if (_ecore_xlib_sync) ecore_x_sync();
-   XFreeColormap(_ecore_x_disp, attr.colormap);
 
    if (parent == DefaultRootWindow(_ecore_x_disp))
      ecore_x_window_defaults_set(win);
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c 
b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
index 8fd2f10..b20047b 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
@@ -180,6 +180,10 @@ evas_software_xlib_outbuf_free(Outbuf *buf)
    if (buf->priv.pal)
       evas_software_xlib_x_color_deallocate(buf->priv.x11.xlib.disp, 
buf->priv.x11.xlib.cmap,
                                           buf->priv.x11.xlib.vis, 
buf->priv.pal);
+
+   /* safe because no effect on the default colormap */
+   XFreeColormap (buf->priv.x11.xlib.disp, buf->priv.x11.xlib.cmap);
+
    eina_array_flush(&buf->priv.onebuf_regions);
    free(buf);
    _clear_xob(0);

-- 


Reply via email to