summaryrefslogtreecommitdiff
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:31 +0200
commit380756f6fb0d7cddf37a9f928650b3e88940b9d7 (patch)
tree7fca76d543b16a9d977b08683514c0a47b4467ff
parentcf86cf5588e3114f43e058d16c87e8ded4c397c6 (diff)
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 4384054f9c..2fac34afb9 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,
1683 CWWinGravity, 1683 CWWinGravity,
1684 &attr); 1684 &attr);
1685 if (_ecore_xlib_sync) ecore_x_sync(); 1685 if (_ecore_xlib_sync) ecore_x_sync();
1686 XFreeColormap(_ecore_x_disp, attr.colormap);
1687 1686
1688 if (parent == DefaultRootWindow(_ecore_x_disp)) 1687 if (parent == DefaultRootWindow(_ecore_x_disp))
1689 ecore_x_window_defaults_set(win); 1688 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)
180 if (buf->priv.pal) 180 if (buf->priv.pal)
181 evas_software_xlib_x_color_deallocate(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.cmap, 181 evas_software_xlib_x_color_deallocate(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.cmap,
182 buf->priv.x11.xlib.vis, buf->priv.pal); 182 buf->priv.x11.xlib.vis, buf->priv.pal);
183
184 /* safe because no effect on the default colormap */
185 XFreeColormap (buf->priv.x11.xlib.disp, buf->priv.x11.xlib.cmap);
186
183 eina_array_flush(&buf->priv.onebuf_regions); 187 eina_array_flush(&buf->priv.onebuf_regions);
184 free(buf); 188 free(buf);
185 _clear_xob(0); 189 _clear_xob(0);