You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2017/05/05 17:44:04 UTC

[jira] [Reopened] (PDFBOX-3545) COSParser.parseXref failing if startXrefOffset over pdf size

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

Tilman Hausherr reopened PDFBOX-3545:
-------------------------------------

I get an NPE with some files, e.g. PDFBOX-3318 here:
{code}
if (isLenient() && trailer.getItem(COSName.ROOT) == null)
{code}
Maybe add a null check for trailer?

Btw the file in that issue worked before the change.

> COSParser.parseXref failing if startXrefOffset over pdf size
> ------------------------------------------------------------
>
>                 Key: PDFBOX-3545
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3545
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.3
>            Reporter: Matus Zamborsky
>            Assignee: Andreas Lehmkühler
>             Fix For: 2.0.6, 3.0.0
>
>         Attachments: 000369.pdf
>
>
> Any PDF which had wrong startxref was parsed with warning in PdfBox 1.8 thanks to self healing mechanism.
> In version 2.0 the COSParser.parseXref (called from PDFParser) tries to seek to the startxref position. 
> If the position is wrong, but within the file size, the PDF is parsed with warning.
> But when the startxref is over the file size, the parsing ended with exception.
> We could either test if startxref is not over source.length(), or catch the exception.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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