[ https://issues.apache.org/jira/browse/PDFBOX-5395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515223#comment-17515223 ]
Aleksej Kozlov commented on PDFBOX-5395: ---------------------------------------- Seems that file contains two signatures. Acrobat Reader says that file cannot be opened (it's ok, I consider the file is broken). Method document.getSignatureDictionaries() returns two elements. Both has filter Adobe.PPKLite / adbe.pkcs7.detached. But when I search in text editor for "ByteRange" there is only one place found. And even for "PPKLite" there is only one place found. Maybe second signature is in compressed stream? At least the problem with hangup is gone. Thank you! > Hangup in COSFilterInputStream.nextRange > ---------------------------------------- > > Key: PDFBOX-5395 > URL: https://issues.apache.org/jira/browse/PDFBOX-5395 > Project: PDFBox > Issue Type: Bug > Affects Versions: 2.0.25 > Reporter: Aleksej Kozlov > Assignee: Tilman Hausherr > Priority: Major > Fix For: 2.0.26, 3.0.0 PDFBox > > > On some broken PDFs call _PDSignature.getSignedContent_ never returns. > After exploring stacktrace I've found cycle in > _COSFilterInputStream.nextRange_. > {code:java} > while (this.position < this.ranges[this.range][0]) > { > long skipped = super.skip(this.ranges[this.range][0] - > this.position); > this.position += skipped; > } > {code} > Javadoc for _skip_ says _"The skip method may, for a variety ofreasons, end > up skipping over some smaller number of bytes, possibly 0."_ > So, when _skip_ returns 0 this cycle became infinite. > Tried in versions 2.0.25 and 3.0.0-RC1. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org