From 19bee7d8946721b8d094937abf1b33889b7c32e5 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 15 Oct 2012 20:01:00 -0700 Subject: jogl: fix bit shift error in LEDataInputStream The readlong() method is attempting to build a 64bit value from two 32 bit reads. The problem is that shifting an int only uses the lower 5 bits of the shift value, so << 32 is the same as << 0. Cast to long and restore the original intention. Signed-off-by: Harvey Harrison --- .../classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java index 37dbc54df..b7262aa3e 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java @@ -180,7 +180,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput { int i1 = readInt(); int i2 = readInt(); - return ((long)(i1) & 0xFFFFFFFFL) + (i2 << 32); + return ((long)i1 & 0xFFFFFFFFL) + ((long)i2 << 32); } public final float readFloat() throws IOException -- cgit v1.2.3 From b9653e6f55a96f3769a980b2569fc9fabad9f374 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 15 Oct 2012 20:24:17 -0700 Subject: jogl: remove infinite loop in Path2D.contains(AABBox) It is impossible to use this method as it will get into an infinite loop as it just calls itself. Base the implementation on the contains method shortly before this method. As this method is impossible to actually use, it could also just be removed. Signed-off-by: Harvey Harrison --- src/jogl/classes/jogamp/graph/geom/plane/Path2D.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java index 8082fe4e1..bf5f5e9b6 100644 --- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java +++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java @@ -397,7 +397,12 @@ public final class Path2D implements Cloneable { } public boolean contains(AABBox r) { - return contains(r); + float lx = r.getMinX(); + float ly = r.getMinY(); + float w = r.getWidth(); + float h = r.getHeight(); + int cross = Crossing.intersectShape(this, lx, ly, w, h); + return cross != Crossing.CROSSING && isInside(cross); } public boolean intersects(AABBox r) { -- cgit v1.2.3 From f15b5df4114e46b4c6a968b75aebb6014afc1806 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 15 Oct 2012 20:28:10 -0700 Subject: jogl: fix bad format string in PngChunkTIME Missing format specifier for the first argument would lead to this throwing IllegalFormatException. Signed-off-by: Harvey Harrison --- src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java index 37e617acb..fa61f6237 100644 --- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java +++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java @@ -75,7 +75,7 @@ public class PngChunkTIME extends PngChunk { /** format YYYY/MM/DD HH:mm:SS */ public String getAsString() { - return String.format("%04/%02d/%02d %02d:%02d:%02d", year, mon, day, hour, min, sec); + return String.format("%04d/%02d/%02d %02d:%02d:%02d", year, mon, day, hour, min, sec); } -- cgit v1.2.3