From: <eli...@us...> - 2008-06-16 18:31:53
|
Revision: 3104 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3104&view=rev Author: elias_naur Date: 2008-06-16 11:31:43 -0700 (Mon, 16 Jun 2008) Log Message: ----------- Linux: Added sanity checking to LinuxDisplay.setIcon Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-06-16 18:29:18 UTC (rev 3103) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2008-06-16 18:31:43 UTC (rev 3104) @@ -1193,10 +1193,12 @@ 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 { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |