- if (hints) {
- if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) {
- // get width, height and depth for the pixmap
- Window root;
- int icon_x, icon_y;
- uint border_width, bpp;
- uint icon_width, icon_height;
-
- XGetGeometry(server.dsp, hints->icon_pixmap, &root, &icon_x, &icon_y, &icon_width, &icon_height, &border_width, &bpp);
-
- //printf(" get_pixmap\n");
- Imlib_Image img;
- imlib_context_set_drawable(hints->icon_pixmap);
- img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, icon_width, icon_height, 0);
- imlib_context_set_image(img);
- unsigned int *data = imlib_image_get_data();
- if (!data) {
- return;
- }
- tsk->icon_width = imlib_image_get_width();
- tsk->icon_height = imlib_image_get_height();
- tsk->icon_data = malloc (tsk->icon_width * tsk->icon_height * sizeof (DATA32));
- memcpy (tsk->icon_data, data, tsk->icon_width * tsk->icon_height * sizeof (DATA32));
- imlib_free_image();
+ if (!hints) return;
+ if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) {
+ // get width, height and depth for the pixmap
+ Window root;
+ int icon_x, icon_y;
+ uint border_width, bpp;
+ uint icon_width, icon_height;
+
+ XGetGeometry(server.dsp, hints->icon_pixmap, &root, &icon_x, &icon_y, &icon_width, &icon_height, &border_width, &bpp);
+
+ //printf(" get_pixmap\n");
+ Imlib_Image img;
+ imlib_context_set_drawable(hints->icon_pixmap);
+ img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, icon_width, icon_height, 0);
+ imlib_context_set_image(img);
+ unsigned int *data = imlib_image_get_data();
+ if (!data) {
+ return;