You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (Jira)" <ji...@apache.org> on 2021/04/06 20:16:00 UTC

[jira] [Assigned] (PDFBOX-5151) Issue with COSObjectKey::fixGeneration

     [ https://issues.apache.org/jira/browse/PDFBOX-5151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler reassigned PDFBOX-5151:
------------------------------------------

    Assignee: Andreas Lehmkühler

> Issue with COSObjectKey::fixGeneration
> --------------------------------------
>
>                 Key: PDFBOX-5151
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5151
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>            Reporter: Roland Meub
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>         Attachments: pdfbox-fixGeneration-bugfix.patch
>
>
> I think, I've just found a little bug within 
> COSParser::validateXrefOffsets, which occures when a xref generation is 
> corrected using COSObjectKey::fixGeneration. 
>  
> The issue is, that COSObjectKey is used as a hash-key and this instance 
> is modified with fixGeneration. 
> Because of this modification, the hasCode of the COSObjectKey is changed 
> and the associated hashmap entry cannot longer be found in the xrefTable. 
> Hashmap key objects should better be immutabel (see 
> [https://howtodoinjava.com/java/collections/hashmap/design-good-key-for-hashmap/]) 
> According to the change history, this issue was introduced with a commit 
> for PDFBOX-4153, but PDFBOX-4490 seems also be related.
>  
> Attached patch-file contains bot, the bugfix and the proposed optimization within COSObjectKey.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org