Update to 6.9.1 breaks merging due to stream length checks #3696
-
|
I get now It is probably not a good idea to use static stream lengths here, but at least to have this value ( Environmentpypy3.11-7.3.20, Linux 64-bit, Debian 11 $ python -m platform
Linux-5.10.0-39-amd64-x86_64-with-glibc2.31
$ python -c "import pypdf;print(pypdf._debug_versions)"
pypdf==6.9.1, crypt_provider=('cryptography', '46.0.5'), PIL=12.1.1TracebackThis is the complete traceback I see: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The relevant change happened in version 6.8.0 to mitigate a memory issue with invalid length values. Version 6.9.1 should not have corresponding changes as far as I am aware.
This already is configurable, see the docs: https://pypdf.readthedocs.io/en/latest/user/security.html#filters (There are some undocumented limit values which are configurable less easily, but you are not hitting them here.) At the moment, this requires monkey-patching: import pypdf.filters
pypdf.filters.MAX_DECLARED_STREAM_LENGTH = 100_000_000
... |
Beta Was this translation helpful? Give feedback.
The relevant change happened in version 6.8.0 to mitigate a memory issue with invalid length values. Version 6.9.1 should not have corresponding changes as far as I am aware.
This already is configurable, see the docs: https://pypdf.readthedocs.io/en/latest/user/security.html#filters (There are some undocumented limit values which are configurable less easily, but you are not hitting them here.)
At the moment, this requires monkey-patching: