Details
-
Type: Bug
-
Status: Closed
-
Priority: 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.
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.