From 7445565df357c2ef561e56ef27c5d60fa936fe18 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sat, 7 Apr 2012 08:26:17 +0000 Subject: [PATCH] Fixed buffer overflow when increasing the size of a BitmapText (issue 486) thanks to Daniel Brunton for the patch http://code.google.com/p/jmonkeyengine/issues/detail?id=486&colspec=ID%20Type%20Status%20Component%20Priority%20Product%20Milestone%20Owner%20Summary&start=100 git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9278 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/util/BufferUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/core/com/jme3/util/BufferUtils.java b/engine/src/core/com/jme3/util/BufferUtils.java index 3e2c556d6..1f4b07b09 100644 --- a/engine/src/core/com/jme3/util/BufferUtils.java +++ b/engine/src/core/com/jme3/util/BufferUtils.java @@ -1062,7 +1062,7 @@ public final class BufferUtils { int position = (buffer != null ? buffer.position() : 0); FloatBuffer newVerts = createFloatBuffer(position + required); if (buffer != null) { - buffer.rewind(); + buffer.flip(); newVerts.put(buffer); newVerts.position(position); } @@ -1076,7 +1076,7 @@ public final class BufferUtils { int position = (buffer != null ? buffer.position() : 0); ShortBuffer newVerts = createShortBuffer(position + required); if (buffer != null) { - buffer.rewind(); + buffer.flip(); newVerts.put(buffer); newVerts.position(position); } @@ -1090,7 +1090,7 @@ public final class BufferUtils { int position = (buffer != null ? buffer.position() : 0); ByteBuffer newVerts = createByteBuffer(position + required); if (buffer != null) { - buffer.rewind(); + buffer.flip(); newVerts.put(buffer); newVerts.position(position); }