You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/02/03 06:34:00 UTC

[jira] [Commented] (PDFBOX-4446) Tolerate some incorrect Xref in PDF file

    [ https://issues.apache.org/jira/browse/PDFBOX-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16759311#comment-16759311 ] 

ASF subversion and git services commented on PDFBOX-4446:
---------------------------------------------------------

Commit 1852813 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1852813 ]

PDFBOX-4446: tolerate some incorrect Xref in PDF file, as suggested by Derek Liu

> Tolerate some incorrect Xref in PDF file
> ----------------------------------------
>
>                 Key: PDFBOX-4446
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4446
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.14, 3.0.0 PDFBox
>            Reporter: Derek Liu
>            Priority: Major
>             Fix For: 2.0.14, 3.0.0 PDFBox
>
>         Attachments: Reproduce_Step.png
>
>
> Some PDF file may not have correct Xref, and we should tolerate them. Or just log an error but not raise exception.
> {code}
>  pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java | 3 +++
>  1 file changed, 3 insertions(+)
> diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java b/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
> index 8ca955ed2..b2b28b258 100644
> --- a/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
> +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
> @@ -721,6 +721,9 @@ public class COSParser extends BaseParser
>                                      }
>                                  }
>  
> +                                if( fileOffset == null ) {
> +                                  continue;
> +                                }
>                                  List<COSObject> stmObjects = objToBeParsed.get(fileOffset);
>                                  if (stmObjects == null)
>                                  {
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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