You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inflate method should return a Uint8Array or throw an error if the inflation is unsuccessful.
Observed Behavior:
In pako version 2 (pako_v2), the inflate method returns undefined instead of a Uint8Array or an error.
There seems to be a discrepancy in how extra bytes at the end of the input data are handled between versions. Version 1 (pako_v1) correctly discards the extra byte 0x0A at the end of the data, while version 2 (pako_v2) does not.
Additional Context:
The input data buffer is extracted from a PDF document's stream object. Some PDF documents may incorrectly specify the Length for stream objects and may also set an incorrect EOL character before endstream, resulting in binary data with extra bytes (such as 0x0A or 0x0D), as in this case.
This behavior is problematic because it affects the ability to process certain PDF streams, which might have incorrectly reported lengths or have an additional EOL character due to incorrect PDF generation.
Could you please look into these issues? The handling of the end bytes is crucial for my use case, where I process PDF files that may not always be correctly formed.
Thank you for your assistance!
The text was updated successfully, but these errors were encountered:
Hello
pako
team,I have encountered a couple of issues with the
inflate
method when working with different versions of thepako
library.Environment:
pako_v1
):1.0.11
pako_v2
):2.1.0
Steps to Reproduce:
pako
using the following commands:Expected Behavior:
The
inflate
method should return aUint8Array
or throw an error if the inflation is unsuccessful.Observed Behavior:
pako
version 2 (pako_v2
), theinflate
method returnsundefined
instead of aUint8Array
or an error.pako_v1
) correctly discards the extra byte0x0A
at the end of the data, while version 2 (pako_v2
) does not.Additional Context:
The input data buffer is extracted from a PDF document's stream object. Some PDF documents may incorrectly specify the
Length
for stream objects and may also set an incorrect EOL character beforeendstream
, resulting in binary data with extra bytes (such as0x0A
or0x0D
), as in this case.This behavior is problematic because it affects the ability to process certain PDF streams, which might have incorrectly reported lengths or have an additional EOL character due to incorrect PDF generation.
Could you please look into these issues? The handling of the end bytes is crucial for my use case, where I process PDF files that may not always be correctly formed.
Thank you for your assistance!
The text was updated successfully, but these errors were encountered: