mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-01-06 00:40:00 +01:00
Linux: Added sanity checking to LinuxDisplay.setIcon
This commit is contained in:
parent
d3b13b23dd
commit
65c180fa48
|
|
@ -1193,10 +1193,12 @@ final class LinuxDisplay implements DisplayImplementation {
|
|||
for (int i=0;i<icons.length;i++) {
|
||||
int size = icons[i].limit() / 4;
|
||||
int dimension = (int)Math.sqrt(size);
|
||||
ByteBuffer icon_rgb = convertIcon(icons[i], dimension, dimension);
|
||||
ByteBuffer icon_mask = convertIconMask(icons[i], dimension, dimension);
|
||||
nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension);
|
||||
return 1;
|
||||
if (dimension > 0) {
|
||||
ByteBuffer icon_rgb = convertIcon(icons[i], dimension, dimension);
|
||||
ByteBuffer icon_mask = convertIconMask(icons[i], dimension, dimension);
|
||||
nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in a new issue