[
https://issues.apache.org/jira/browse/PDFBOX-4925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andreas Lehmkühler resolved PDFBOX-4925.
----------------------------------------
Fix Version/s: 2.0.27
Resolution: Fixed
I didn't backport the trunk code but found another solution. The trick is to
skip (most of) the dictionary to avoid flase positive findings of the key word
{{stream}}
> Invalid stream Length validation in StreamValidationProcess
> -----------------------------------------------------------
>
> Key: PDFBOX-4925
> URL: https://issues.apache.org/jira/browse/PDFBOX-4925
> Project: PDFBox
> Issue Type: Bug
> Components: Preflight
> Affects Versions: 2.0.19, 2.0.20
> Reporter: Adomas Birštunas
> Assignee: Andreas Lehmkühler
> Priority: Major
> Fix For: 2.0.27
>
> Attachments: PdfWithEmbeddedFileStream.pdf,
> StreamValidationProcessFixedBugPdfBox_4925.java
>
>
> org.apache.pdfbox.preflight.process.StreamValidationProcess Length of the
> stream validation is invalid.
> If Stream dictionray contains "\nstream", it find wrong stream start position.
> Therefore, it reports an error for the wrong stream length, despite stream
> length is correct.
> PdfWithEmbeddedFileStream.pdf - is an example of PDF containing stream for
> embedded file stream, which raises an error
> "ERROR_SYNTAX_STREAM_LENGTH_INVALID: Body Syntax error, Stream length is
> invalid [cObj=COSObject\{18, 0}; defined length=372; buffer2= V6 t ".
> The problem was caused by the "/Subtype /application#2Foctet-stream" which
> contains "stream\n".
> Trying to find stream start position it is not enough to search for the
> "stream".
> As a fix I suggest first to skip dictionary bytes.
> The fixing code may be find in
> StreamValidationProcessFixedBugPdfBox_4925.java.
>
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]