We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a865345 commit 64f6d4eCopy full SHA for 64f6d4e
1 file changed
src/PIL/PdfParser.py
@@ -402,7 +402,11 @@ def __init__(
402
self.pages_ref: IndirectReference | None
403
self.last_xref_section_offset: int | None
404
if self.buf:
405
- self.read_pdf_info()
+ try:
406
+ self.read_pdf_info()
407
+ except PdfFormatError:
408
+ self.close()
409
+ raise
410
else:
411
self.file_size_total = self.file_size_this = 0
412
self.root = PdfDict()
0 commit comments