ICEpdf
  1. ICEpdf
  2. PDF-94

PTrailer incorrectly appling previous trainer dictionary values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 4.0 - Beta, 4.0
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      I came across an issue when trying to add new object a a PDF. When I asked the PTrailer for the next available object number I was given the number of an object that was already in use. After tracing the document a bit and our trailer code I found an issue in how we where coping dictionary values from the previous trailer to the current. This appears to be a long standing bug but because we never actually used the size data in the past release it was not an issue.

        Activity

        Hide
        Patrick Corless added a comment -

        The PTrailer has two methods that copy properties from previous or next trailers if the property doesn't exist in the origional trailer. The code previously did a check for the property key with !dictionary.contains(key) which always returned true and values where incorrectly over written.

        I updated the hash code to read !dictionary.containsKey(key) and the copy worked as expected. I suspect his was just an hash API typo.

        I know correctly get the next object number in the the file.

        Show
        Patrick Corless added a comment - The PTrailer has two methods that copy properties from previous or next trailers if the property doesn't exist in the origional trailer. The code previously did a check for the property key with !dictionary.contains(key) which always returned true and values where incorrectly over written. I updated the hash code to read !dictionary.containsKey(key) and the copy worked as expected. I suspect his was just an hash API typo. I know correctly get the next object number in the the file.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: