aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Isorce <j.isorce@samsung.com>2014-08-21 18:40:01 +0900
committerCedric BAIL <cedric@osg.samsung.com>2014-08-21 16:02:41 +0200
commit4b8c999df6317723415eed9f01c943ab6b9c6e88 (patch)
treed18f31b6d7fd4f582a6259c945dc1b0d73ea0691
parentecore_evas: Ecore_Evas_X - make sure that ecore evas post render is always ca... (diff)
downloadefl-4b8c999df6317723415eed9f01c943ab6b9c6e88.tar.gz
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
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_window.c1
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_outbuf.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_window.c b/src/lib/ecore_x/xlib/ecore_x_window.c
index 860e2bf9dc..ba73ccf449 100644
--- a/src/lib/ecore_x/xlib/ecore_x_window.c
+++ b/src/lib/ecore_x/xlib/ecore_x_window.c
@@ -1669,7 +1669,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 a189accc27..db8f6558f6 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);