You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Adomas Birštunas (Jira)" <ji...@apache.org> on 2020/07/27 12:20:00 UTC

[jira] [Updated] (PDFBOX-4925) Invalid stream Length validation in StreamValidationProcess

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

Adomas Birštunas updated PDFBOX-4925:
-------------------------------------
    Attachment:     (was: StreamValidationProcessFixedBug.java)

> 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
>            Reporter: Adomas Birštunas
>            Priority: Major
>         Attachments: PdfWithEmbeddedFileStream.pdf
>
>
> 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 StreamValidationProcessFixedBug.java.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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