ICEpdf
  1. ICEpdf
  2. PDF-535

ArrayIndexOutOfBoundsException thrown from Indexed.init()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.4, 4.4, 5.0.0 alpha1
    • Fix Version/s: 4.4.1, 5.0
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Customer is printing them as images from the pdf itself using BullZip to be able to open them in icepdf.

      Description

      The following stack trace is thrown when rendering the provided PDF files:

      java.lang.ArrayIndexOutOfBoundsException: 6
      at org.icepdf.core.pobjects.graphics.Indexed.init(Indexed.java:104)
      at org.icepdf.core.pobjects.Resources.getColorSpace(Resources.java:199)
      at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2209)
      at org.icepdf.core.pobjects.Resources.getImage(Resources.java:252)
      at org.icepdf.core.util.ContentParser.consume_Do(ContentParser.java:2001)
      at org.icepdf.core.util.ContentParser.parse(ContentParser.java:382)
      at org.icepdf.core.pobjects.Page.init(Page.java:372)
      at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1072)
      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:662)

        Activity

        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34205 Wed Apr 03 10:58:25 MDT 2013 patrick.corless PDF-535 addition of adjustment code to make sure the copy get the write byte length.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/Indexed.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34204 Wed Apr 03 10:57:36 MDT 2013 patrick.corless PDF-535 addition of adjustment code to make sure the copy get the write byte length.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-4.3.3/icepdf/core/src/org/icepdf/core/pobjects/graphics/Indexed.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34123 Thu Mar 28 11:52:50 MDT 2013 patrick.corless PDF-535 updated the colour data table to make sure the expected length is kept and if needed padded with zeros.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-4.3.3/icepdf/core/src/org/icepdf/core/pobjects/graphics/Indexed.java
        Patrick Corless made changes -
        Fix Version/s 4.4.1 [ 10871 ]
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0 [ 10314 ]
        Resolution Fixed [ 1 ]
        Hide
        Patrick Corless added a comment -

        Will run QA bu the test files are correctly loading now.

        Show
        Patrick Corless added a comment - Will run QA bu the test files are correctly loading now.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34122 Thu Mar 28 11:48:05 MDT 2013 patrick.corless PDF-535 updated the colour data table to make sure the expected length is kept and if needed padded with zeros.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/graphics/Indexed.java
        Hide
        Patrick Corless added a comment -

        All the files are using Indexed colour model that specifies the colour lookup table as a stream. In all these cases the parsed stream is a little short and doesn't match m * (hival + 1). So I've added an array copy check to make sure the array is the correct size and padded with zeros if it's a little to short.

        Show
        Patrick Corless added a comment - All the files are using Indexed colour model that specifies the colour lookup table as a stream. In all these cases the parsed stream is a little short and doesn't match m * (hival + 1). So I've added an array copy check to make sure the array is the correct size and padded with zeros if it's a little to short.
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case Reference 5007000000PYKy7AAH
        Arran Mccullough created issue -

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: