From cf1f74660c0dd4d5b5e046e6a39cd69147a86c46 Mon Sep 17 00:00:00 2001 From: Brian Matzon Date: Mon, 3 May 2004 15:06:51 +0000 Subject: [PATCH] fixed glBitmap, as reported by christophe choquet --- src/java/org/lwjgl/opengl/GL11.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/GL11.java b/src/java/org/lwjgl/opengl/GL11.java index 21b0ed18..1ab76a3a 100644 --- a/src/java/org/lwjgl/opengl/GL11.java +++ b/src/java/org/lwjgl/opengl/GL11.java @@ -739,7 +739,7 @@ public final class GL11 { public static native void glCallList(int list); public static native void glBlendFunc(int sfactor, int dfactor); public static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) { - if (bitmap.remaining() < width * height) { + if (bitmap.remaining() < ((width+7)/8) * height) { throw new BufferUnderflowException(); } nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position());