* Fix crash with unencrypted metadata values (pdfminer#766). * Explicitly check for length * Update CHANGELOG.md Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>pull/768/head^2
parent
1044fc05e8
commit
f63e9fbee9
|
@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
### Fixed
|
||||
|
||||
- `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766))
|
||||
- Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760))
|
||||
- `TypeError` when getting default width of font ([#720](https://github.com/pdfminer/pdfminer.six/issues/720))
|
||||
|
||||
|
|
|
@ -138,6 +138,8 @@ def resolve_all(x: object, default: object = None) -> Any:
|
|||
def decipher_all(decipher: DecipherCallable, objid: int, genno: int, x: object) -> Any:
|
||||
"""Recursively deciphers the given object."""
|
||||
if isinstance(x, bytes):
|
||||
if len(x) == 0:
|
||||
return x
|
||||
return decipher(objid, genno, x)
|
||||
if isinstance(x, list):
|
||||
x = [decipher_all(decipher, objid, genno, v) for v in x]
|
||||
|
|
Loading…
Reference in New Issue