Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2187

ArrayIndexOutOfBoundsException in TIFFFaxDecoder

    XMLWordPrintableJSON

Details

    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];
      

      Attachments

        1. tiffT6-line916-005541u.pdf
          278 kB
          Tilman Hausherr
        2. tiffT6-line1002-p002145u.pdf
          1.46 MB
          Tilman Hausherr
        3. tiffT6-line1002-002489.pdf
          626 kB
          Tilman Hausherr
        4. tiffT6-line1002-002145.pdf
          200 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: