You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Adam Nichols (JIRA)" <ji...@apache.org> on 2010/12/28 01:40:51 UTC
[jira] Resolved: (PDFBOX-928) added NPE protection which occurred
when reading corrupt PDFs
[ https://issues.apache.org/jira/browse/PDFBOX-928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Nichols resolved PDFBOX-928.
---------------------------------
Resolution: Fixed
Committed in revision 1053229
> added NPE protection which occurred when reading corrupt PDFs
> -------------------------------------------------------------
>
> Key: PDFBOX-928
> URL: https://issues.apache.org/jira/browse/PDFBOX-928
> Project: PDFBox
> Issue Type: Improvement
> Components: PDModel
> Affects Versions: 0.8.0-incubator, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.1, 1.4.0
> Reporter: Adam Nichols
> Assignee: Adam Nichols
> Priority: Trivial
> Fix For: 1.5.0
>
>
> I came across a non-conforming PDF which resulted in a NPE when I tried to append a page to the document. The error was because there were no kids listed, so when rootPages.getKids().add(page); was called in addPage(PDPage page) it went into the COSArray.add() but threw an exception on line 180: array.add(((COSObjectable)o).getCOSObject()); I fixed this by checking to see if array was null before attempting to call the add() method.
> I can not attach the sample PDF because it contains confidential data.
> Despite the major non-conforming aspects of this PDF, Adobe reader is able to open it. This is one reason why I want to make sure PDFBox can at least process the file without throwing an exception.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.