From: raster Date: Wed, 29 Feb 2012 11:59:55 +0000 (+0000) Subject: netwm icon set api - test it.. putting 16mb+ icons on the stack wasnt X-Git-Tag: accepted/2.0/20130306.224007~63^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a82c257aa8f1305f9c8d5a2284d28d3d9c926799;p=profile%2Fivi%2Fecore.git netwm icon set api - test it.. putting 16mb+ icons on the stack wasnt a good idea... puton heap. :) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@68550 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_x/xcb/ecore_xcb_netwm.c b/src/lib/ecore_x/xcb/ecore_xcb_netwm.c index dc21f15..b1e0622 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_netwm.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_netwm.c @@ -852,7 +852,8 @@ ecore_x_netwm_icons_set(Ecore_X_Window win, { size += 2 + (icon[i].width * icon[i].height); } - data = alloca(size * sizeof(unsigned int)); + data = malloc(size * sizeof(unsigned int)); + if (!data) return; p = data; for (i = 0; i < (unsigned int)num; i++) { @@ -884,6 +885,7 @@ ecore_x_netwm_icons_set(Ecore_X_Window win, } ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON, data, size); + free(data); } EAPI Eina_Bool diff --git a/src/lib/ecore_x/xlib/ecore_x_netwm.c b/src/lib/ecore_x/xlib/ecore_x_netwm.c index 1890359..3076c3c 100644 --- a/src/lib/ecore_x/xlib/ecore_x_netwm.c +++ b/src/lib/ecore_x/xlib/ecore_x_netwm.c @@ -675,7 +675,8 @@ ecore_x_netwm_icons_set(Ecore_X_Window win, { size += 2 + (icon[i].width * icon[i].height); } - data = alloca(size * sizeof(unsigned int)); + data = malloc(size * sizeof(unsigned int)); + if (!data) return; p = data; for (i = 0; i < (unsigned int)num; i++) { @@ -708,6 +709,7 @@ ecore_x_netwm_icons_set(Ecore_X_Window win, } ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON, data, size); + free(data); } EAPI Eina_Bool