From 74c573c6dd6298e3f1dedca415a7aad86a22be38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malthe=20J=C3=B8rgensen?= Date: Thu, 16 Jul 2020 22:20:53 +0200 Subject: [PATCH] readObjectHeader: Allow extra whitespace before "obj" The header being read has the format: obj where `` and `` are integers. Previously an arbitrary number of spaces was being allowed between `` and ``, but not between `` and `obj`. We now allow arbitrary spaces between `` and `obj`. --- PyPDF2/pdf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PyPDF2/pdf.py b/PyPDF2/pdf.py index 1d0e950117..4c65b1e6ce 100644 --- a/PyPDF2/pdf.py +++ b/PyPDF2/pdf.py @@ -1734,6 +1734,7 @@ def readObjectHeader(self, stream): idnum = readUntilWhitespace(stream) extra |= utils.skipOverWhitespace(stream); stream.seek(-1, 1) generation = readUntilWhitespace(stream) + extra |= utils.skipOverWhitespace(stream); stream.seek(-1, 1) # although it's not used, it might still be necessary to read _obj = stream.read(3) # noqa: F841