diff options
| author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-06-19 16:18:39 +0300 |
|---|---|---|
| committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-07-03 13:48:28 +0300 |
| commit | 9c5a0c6c102556c229825e053153d02fb7141668 (patch) | |
| tree | 026374922e004f48fae8057f982f2d3c26c5018a /platform/linuxbsd | |
| parent | 46424488edc341b65467ee7fd3ac423e4d49ad34 (diff) | |
| download | redot-engine-9c5a0c6c102556c229825e053153d02fb7141668.tar.gz | |
Add error checks and harmonize behavior of the set_icon method.
Diffstat (limited to 'platform/linuxbsd')
| -rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index 8724bc871a..5e735a998e 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -4880,6 +4880,8 @@ void DisplayServerX11::set_icon(const Ref<Image> &p_icon) { Atom net_wm_icon = XInternAtom(x11_display, "_NET_WM_ICON", False); if (p_icon.is_valid()) { + ERR_FAIL_COND(p_icon->get_width() <= 0 || p_icon->get_height() <= 0); + Ref<Image> img = p_icon->duplicate(); img->convert(Image::FORMAT_RGBA8); |
