ICEpdf
  1. ICEpdf
  2. PDF-730

Race condition in org.icepdf.core.pobjects.ImageStream causing NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.6
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      N/A

      Description

      There is a race condition on field colourSpace in org.icepdf.core.pobjects.ImageStream.getImage(Color fill, Resources resources) causing occasional NullPointerException.
      Seems to be introduced in svn revision 38841 (5.0.x branch)

      Fix: make colourSpace local within getImage() and update field at the end.
      (I can provide patch, but I haven't bothered with Contributor Agreement thing yet and it's a trivial fix).

        Activity

        Hide
        Patrick Corless added a comment -

        Could you post a sample file in which we can test our fix against?

        Show
        Patrick Corless added a comment - Could you post a sample file in which we can test our fix against?
        Hide
        Patrick Corless added a comment -

        Applied a theoretical fix for the potential race condition when getImage() is called from a separate thread and getColorSpace() on another.

        Show
        Patrick Corless added a comment - Applied a theoretical fix for the potential race condition when getImage() is called from a separate thread and getColorSpace() on another.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: