You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Marco Monacelli (JIRA)" <ji...@apache.org> on 2017/01/19 16:18:26 UTC

[jira] [Updated] (PDFBOX-3627) "/Prev loop at offset 77418" on a valid document

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

Marco Monacelli updated PDFBOX-3627:
------------------------------------
    Attachment: patch_from_version_2.0.3

I have create a fix for versione 2.0.3 and never

The problem is in searchNearestValue function particularly when the current offset is distant only one byte from next xref.

In this case the difference is -1 and cause a wrong evaluation of the next condition. I then replaced the primitive type with an object and as a condition I put null instead of -1.

I also added a check in checkXRefOffset function to delete the spaces, but this second check is only to speed you can not apply the first.



> "/Prev loop at offset 77418" on a valid document
> ------------------------------------------------
>
>                 Key: PDFBOX-3627
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3627
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.3
>         Environment: Windows 7 x64, JVM 1.8.0_101
>            Reporter: Seva Alekseyev
>         Attachments: CIT_2.pdf, patch_from_version_2.0.3
>
>
> On the attached document, which opens fine with Word, the PDDocument.load() is throwing an error:
> java.io.IOException: /Prev loop at offset 77418
> 	at org.apache.pdfbox.pdfparser.COSParser.parseXref(COSParser.java:320)
> 	at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:194)
> 	at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:252)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:966)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:922)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:870)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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