bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/27435] New: java.util.zip - ArrayIndexOutOfBoundsExceptio


From: krasoft at hotmail dot com
Subject: [Bug classpath/27435] New: java.util.zip - ArrayIndexOutOfBoundsException uding deflateFast()
Date: 4 May 2006 18:32:44 -0000

Using fast ZIP compression ("1" in my case) I get the following exception:

java.lang.ArrayIndexOutOfBoundsException: 16384
        at java.util.zip.DeflaterHuffman.tallyDist(DeflaterHuffman.java:762)
        at java.util.zip.DeflaterEngine.deflateFast(DeflaterEngine.java:500)
        at java.util.zip.DeflaterEngine.deflate(DeflaterEngine.java:658)
        at java.util.zip.Deflater.deflate(Deflater.java:442)
        at
java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:84)
        at
java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:196)
...

The index gets out of bounds because in the deflateFast() it keeps looping
after huffman.tallyDist() even if the buffer is full.

I think, you need to remove the "continue" command from the line 519 of the
DeflaterEngine.deflateFast() to let it check if the buffer is full to flush and
reset:

private boolean deflateFast() {
  while ()
    if () {
      huffman.tallyDist();
//      continue;
    } else {
      huffman.tallyLit();
    }

    if (huffman.isFull()) {
      huffman.flushBlock();
      return !lastBlock;
    }
  }
  return true;
}

I hope you've got the idea.

Thanks,

Pavel Krassikov


-- 
           Summary: java.util.zip - ArrayIndexOutOfBoundsException uding
                    deflateFast()
           Product: classpath
           Version: 0.90
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: krasoft at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27435





reply via email to

[Prev in Thread] Current Thread [Next in Thread]