From ab201e207c2f0b3b461024d8a8fade10d54e385c Mon Sep 17 00:00:00 2001 From: Denis Molony Date: Mon, 18 Jul 2016 08:52:29 +1000 Subject: [PATCH] allow out-of-order shape tables --- src/com/bytezone/diskbrowser/applefile/ShapeTable.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/bytezone/diskbrowser/applefile/ShapeTable.java b/src/com/bytezone/diskbrowser/applefile/ShapeTable.java index 4e60db1..307e119 100755 --- a/src/com/bytezone/diskbrowser/applefile/ShapeTable.java +++ b/src/com/bytezone/diskbrowser/applefile/ShapeTable.java @@ -34,7 +34,7 @@ public class ShapeTable extends AbstractFile int v1 = value >> 6; int v2 = (value & 0x38) >> 3; int v3 = value & 0x07; -// System.out.printf ("%02X %02X %02X %02X%n", value, v1, v2, v3); + // System.out.printf ("%02X %02X %02X %02X%n", value, v1, v2, v3); if (v3 >= 4) { @@ -129,7 +129,7 @@ public class ShapeTable extends AbstractFile if (totalShapes == 0) return false; - int lastOffset = 0; + // int lastOffset = 0; for (int i = 0; i < totalShapes; i++) { // check index table entry is inside the file @@ -139,10 +139,11 @@ public class ShapeTable extends AbstractFile // check index points inside the file int offset = HexFormatter.intValue (buffer[ptr], buffer[ptr + 1]); - if (offset == 0 || offset < lastOffset || offset >= buffer.length) + // if (offset == 0 || offset < lastOffset || offset >= buffer.length) + if (offset == 0 || offset >= buffer.length) return false; - lastOffset = offset; + // lastOffset = offset; } return true;