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:19 +0200
commit05b66b5a82d05920c224624c556411a12e9d178d (patch)
tree651300bf19fe709488be7a8036e4073d5dde9069
parent9177e696b865e0fcaa2e1cfaf3dfcf7b0769fd6c (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 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,
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 a189acc..db8f655 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);