Repository: commons-compress
Updated Branches:
  refs/heads/COMPRESS-453 [created] e899bcd1a


add a bunch of printf debugging for COMPRESS-453


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/e899bcd1
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/e899bcd1
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/e899bcd1

Branch: refs/heads/COMPRESS-453
Commit: e899bcd1aaa0f9c34510afbfce21ea5cdecef29a
Parents: 6c52485
Author: Stefan Bodewig <bode...@apache.org>
Authored: Wed May 23 15:24:16 2018 +0200
Committer: Stefan Bodewig <bode...@apache.org>
Committed: Wed May 23 15:24:16 2018 +0200

----------------------------------------------------------------------
 .../compressors/bzip2/BZip2CompressorInputStream.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/e899bcd1/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
 
b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index 97f6982..ba9cf17 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@ -575,6 +575,7 @@ public class BZip2CompressorInputStream extends 
CompressorInputStream
     }
 
     private void getAndMoveToFrontDecode() throws IOException {
+        System.err.println("In getAndMoveToFrontDecode");
         final BitInputStream bin = this.bin;
         this.origPtr = bsR(bin, 24);
         recvDecodingTables();
@@ -605,6 +606,7 @@ public class BZip2CompressorInputStream extends 
CompressorInputStream
         int groupPos = G_SIZE - 1;
         final int eob = this.nInUse + 1;
         int nextSym = getAndMoveToFrontDecode0();
+        System.err.println("Initial nextSym: " + nextSym);
         int lastShadow = -1;
         int zt = selector[groupNo] & 0xff;
         checkBounds(zt, N_GROUPS, "zt");
@@ -649,6 +651,7 @@ public class BZip2CompressorInputStream extends 
CompressorInputStream
                     final int tmp = zvec - base_zt[zn];
                     checkBounds(tmp, MAX_ALPHA_SIZE, "zvec");
                     nextSym = perm_zt[tmp];
+                    System.err.println("nextSym in RLE loop: " + nextSym);
                 }
 
                 final int yy0 = yy[0];
@@ -656,16 +659,18 @@ public class BZip2CompressorInputStream extends 
CompressorInputStream
                 final byte ch = seqToUnseq[yy0];
                 unzftab[ch & 0xff] += s + 1;
 
+                System.err.println("s: " + s);
                 while (s-- >= 0) {
                     ll8[++lastShadow] = ch;
                 }
 
                 if (lastShadow >= limitLast) {
-                    throw new IOException("block overrun");
+                    throw new IOException("block overrun while expanding RLE 
in MTF, "
+                        + lastShadow + " exceeds " + limitLast);
                 }
             } else {
                 if (++lastShadow >= limitLast) {
-                    throw new IOException("block overrun");
+                    throw new IOException("block overrun, " + lastShadow + " 
exceeds " + limitLast);
                 }
                 checkBounds(nextSym, 256 + 1, "nextSym");
 
@@ -712,6 +717,7 @@ public class BZip2CompressorInputStream extends 
CompressorInputStream
                 final int idx = zvec - base_zt[zn];
                 checkBounds(idx, MAX_ALPHA_SIZE, "zvec");
                 nextSym = perm_zt[idx];
+                System.err.println("New nextSym: " + nextSym);
             }
         }
 

Reply via email to