Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.6, 1.8.7, 2.0.0
Description
I get ArrayIndexOutOfBoundsExceptions at two locations with several files from the digitalcorpora site:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 16
at org.apache.pdfbox.filter.ccitt.TIFFFaxDecoder.decodeT6(TIFFFaxDecoder
.java:1002) at org.apache.pdfbox.filter.CCITTFaxFilter.decode(CCITTFaxFilter.java:95)
...
or
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException:1
at org.apache.pdfbox.filter.ccitt.TIFFFaxDecoder.decodeT6(TIFFFaxDecoder.java:916) at org.apache.pdfbox.filter.CCITTFaxFilter.decode(CCITTFaxFilter.java:95)
The fix, which is also used by others who use the same code and which solves both exceptions, is to increase w by one in this segment:
this.prevChangingElems = new int[w]; this.currChangingElems = new int[w];