ICEpdf
  1. ICEpdf
  2. PDF-327

ArrayIndexOutOfBoundsException in JBIG2

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.2
    • Fix Version/s: 5.0.4
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -
    • Salesforce Case Reference:

      Description

      The PDF does not render the following exception is thrown:

      FINE: Error getting image by name: Im0
      java.lang.ArrayIndexOutOfBoundsException: 1
      at org.jpedal.jbig2.io.StreamReader.readByte(StreamReader.java:93)
      at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.handleSegmentNumber(JBIG2StreamDecoder.java:504)
      at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.readSegmentHeader(JBIG2StreamDecoder.java:470)
      at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.readSegments(JBIG2StreamDecoder.java:225)
      at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.decodeJBIG2(JBIG2StreamDecoder.java:134)
      at org.jpedal.jbig2.JBIG2Decoder.decodeJBIG2(JBIG2Decoder.java:149)
      at org.icepdf.core.pobjects.Stream.jbig2Decode(Stream.java:867)
      at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2131)
      at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2042)
      at org.icepdf.core.pobjects.Resources.getImage(Resources.java:264)
      at org.icepdf.core.util.ContentParser.consume_Do(ContentParser.java:1971)
      at org.icepdf.core.util.ContentParser.parse(ContentParser.java:391)
      at org.icepdf.core.pobjects.Page.init(Page.java:390)
      at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1077)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)

      This user has also logged PDF-278.
      1. 10692.pdf
        87 kB
        Tyler Johnson
      2. sc10452.pdf
        253 kB
        Tyler Johnson

        Activity

        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #38308 Mon Sep 30 08:48:24 MDT 2013 patrick.corless PDF-327 addition levigo jbig2 image libraries for ICEpdf PRO
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Patrick Corless added a comment -

        We are moving away from the jbig2 implementation provided by jpedal and are moving to the Levigo library. The library is licensed under LGPA so we won't be distributing it with the OS bundle but if added to the class path ICEpdf will try to use it.

        We licensed a special commercial version of Levigo which we are shipping with the PRO version for our enterprise customers.

        Show
        Patrick Corless added a comment - We are moving away from the jbig2 implementation provided by jpedal and are moving to the Levigo library. The library is licensed under LGPA so we won't be distributing it with the OS bundle but if added to the class path ICEpdf will try to use it. We licensed a special commercial version of Levigo which we are shipping with the PRO version for our enterprise customers.
        Patrick Corless made changes -
        Fix Version/s 5.0.4 [ 11072 ]
        Fix Version/s 5.1 [ 10675 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #38299 Fri Sep 27 14:40:33 MDT 2013 patrick.corless PDF-327 addition levigo jbig2 image libraries for ICEpdf PRO
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Judy Guglielmin made changes -
        Salesforce Case Reference 5007000000W7SKlAAN
        Hide
        Patrick Corless added a comment -

        We've secured a license for a new JIG2 library that can correctly decode the examples in question. We'll e adding the new library in 5.1 PRO.

        Show
        Patrick Corless added a comment - We've secured a license for a new JIG2 library that can correctly decode the examples in question. We'll e adding the new library in 5.1 PRO.
        Patrick Corless made changes -
        Fix Version/s 5.1 [ 10675 ]
        Fix Version/s 5.0.1 [ 10872 ]
        Patrick Corless made changes -
        Fix Version/s 5.0.1 [ 10872 ]
        Fix Version/s 5.0 [ 10314 ]
        Patrick Corless made changes -
        Fix Version/s 5.0 [ 10314 ]
        Fix Version/s 4.3 [ 10266 ]
        Hide
        Patrick Corless added a comment -

        Likely also related to PDF-342 moving out to 5.0.

        Show
        Patrick Corless added a comment - Likely also related to PDF-342 moving out to 5.0.
        Hide
        Tyler Johnson added a comment -

        Same customer has reported another very similar issue in that the exceptions are the same. Attaching PDF.

        Show
        Tyler Johnson added a comment - Same customer has reported another very similar issue in that the exceptions are the same. Attaching PDF.
        Tyler Johnson made changes -
        Attachment 10692.pdf [ 13758 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000I1Z6Y] [5007000000I1Z6Y, 5007000000JN7oR]
        Patrick Corless made changes -
        Fix Version/s 4.3 [ 10266 ]
        Hide
        Patrick Corless added a comment -

        This is a strange bug but should be relatively easy to fix. The jbig images decodeParams points to an empty stream object (13 0 obj) that has a specific length of zero. Our stream parser seem to ignore this and return a few bytes between the stream .. endstream which is throwing off the jbig decoder.

        We can take a look at fixing the stream parser to check the stream length or we can add a few checks in the jbig decode to makes sure the decode params length is valid.

        Show
        Patrick Corless added a comment - This is a strange bug but should be relatively easy to fix. The jbig images decodeParams points to an empty stream object (13 0 obj) that has a specific length of zero. Our stream parser seem to ignore this and return a few bytes between the stream .. endstream which is throwing off the jbig decoder. We can take a look at fixing the stream parser to check the stream length or we can add a few checks in the jbig decode to makes sure the decode params length is valid.
        Tyler Johnson made changes -
        Salesforce Case [5007000000I1Z6Y]
        Tyler Johnson made changes -
        Field Original Value New Value
        Attachment sc10452.pdf [ 13492 ]
        Tyler Johnson created issue -

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: