ArrayIndexOutOfBoundsException in CCITTFaxDecoderStream.decode2D
See original GitHub issueException in thread "main" java.lang.ArrayIndexOutOfBoundsException: 25
at com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxDecoderStream.decode2D(CCITTFaxDecoderStream.java:184)
at com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxDecoderStream.decodeRowType6(CCITTFaxDecoderStream.java:275)
at com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxDecoderStream.decodeRow(CCITTFaxDecoderStream.java:287)
at com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxDecoderStream.fetch(CCITTFaxDecoderStream.java:114)
at com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxDecoderStream.read(CCITTFaxDecoderStream.java:439)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at java.io.DataInputStream.readFully(DataInputStream.java:169)
at com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReader.readStripTileData(TIFFImageReader.java:1508)
at com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReader.read(TIFFImageReader.java:934)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1308)
at TwelveMonkeysTest.main(TwelveMonkeysTest.java:57)
This file comes from a stream in a PDF file, I constructed the TIF header myself. The PDF file displays properly in Adobe Reader, ghostscript and in PDF.js.
I tried to change the offending code line to do nothing if the index is out of bounds and that works, but I don’t know if this the best solution.
Unrelated and unimportant: I looked at the changes since we copied the code from CCITTFaxDecoderStream.java - why does getNextChangingElement() declare a “throws IOException”? I can’t see where this would be thrown.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
2.0.5 - [Custom Search] - ASF JIRA
ArrayIndexOutOfBoundsException in CCITTFaxDecoderStream.decode2D. PDFBOX-3700Closed. 12. OutOfMemoryException converting PDF to TIFF Images.
Read more >What causes a java.lang.ArrayIndexOutOfBoundsException ...
Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal...
Read more >ArrayIndexOutOfBoundsException (Java SE 19 & JDK 19)
Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed using @Schmidor’s suggestion. Many thanks.
– Harald K
Thanks both!