question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArrayIndexOutOfBoundsException in CCITTFaxDecoderStream.decode2D

See original GitHub issue
Exception 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)


223423.zip

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:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
haraldkcommented, Mar 9, 2017

Fixed using @Schmidor’s suggestion. Many thanks.

– Harald K

0reactions
THausherrcommented, Mar 9, 2017

Thanks both!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found