netwm icon set api - test it.. putting 16mb+ icons on the stack wasnt
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Feb 2012 11:59:55 +0000 (11:59 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Feb 2012 11:59:55 +0000 (11:59 +0000)
a good idea... puton heap. :)

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@68550 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xcb/ecore_xcb_netwm.c
src/lib/ecore_x/xlib/ecore_x_netwm.c

index dc21f15..b1e0622 100644 (file)
@@ -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
index 1890359..3076c3c 100644 (file)
@@ -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