1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-08 08:53:31 +02:00

wmaker: fix crash for windows without WM_HINTS

This patch is adding a guard before calling wm_hints->icon_pixmap.
Crash can be reproduced with decoration-less apps when disabling
"Emulate application icon" attribute.

Ref:

Program terminated with signal SIGSEGV, Segmentation fault.
806 if (!getSize(wwin->wm_hints->icon_pixmap, &w, &h, &d)) {
[Current thread is 1 (Thread 0x7ffff660ed40 (LWP 29297))]
This commit is contained in:
David Maciejak
2026-04-04 15:49:04 -04:00
committed by Carlos R. Mafra
parent 62e341b5cc
commit ee9fd77a56

View File

@@ -803,6 +803,9 @@ RImage *get_rimage_icon_from_wm_hints(WIcon *icon)
wwin = icon->owner; wwin = icon->owner;
if (!wwin->wm_hints)
return NULL;
if (!getSize(wwin->wm_hints->icon_pixmap, &w, &h, &d)) { if (!getSize(wwin->wm_hints->icon_pixmap, &w, &h, &d)) {
icon->owner->wm_hints->flags &= ~IconPixmapHint; icon->owner->wm_hints->flags &= ~IconPixmapHint;
return NULL; return NULL;