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/06/30 16:21:00 UTC
[jira] [Commented] (PDFBOX-3849) COSParser crashed with corrupt PDF
[ https://issues.apache.org/jira/browse/PDFBOX-3849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16070356#comment-16070356 ]
Tilman Hausherr commented on PDFBOX-3849:
-----------------------------------------
I object to the word "crashed". It threw a checked exception. Btw the upcoming 2.0.7 no longer does this. But even if it did - regardless how we'd name it, it would still be an exception.
> COSParser crashed with corrupt PDF
> ----------------------------------
>
> Key: PDFBOX-3849
> URL: https://issues.apache.org/jira/browse/PDFBOX-3849
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.6
> Reporter: Jorge Spinsanti
> Attachments: IOException.pdf
>
>
> When parsing corrupt PDF file, PDFBox crashed:
> {code}
> Caused by: java.io.IOException: Error reading stream, expected='endstream' actual='' at offset 116070
> at org.apache.pdfbox.pdfparser.COSParser.parseCOSStream(COSParser.java:1013)
> at org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:781)
> at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:742)
> at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:673)
> at org.apache.pdfbox.pdfparser.COSParser.parseDictObjects(COSParser.java:633)
> at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:241)
> at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:276)
> at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1132)
> at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1066)
> at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:141)
> at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
> ... 23 more
> {code}
> Can you thrown a specific exception to allow better error handling? Something like BadInputException, CorruptFileException or similar.
> See related Tika issue: https://issues.apache.org/jira/browse/TIKA-2407
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org