Skip to content

Commit

Permalink
readObjectHeader: Allow extra whitespace before "obj"
Browse files Browse the repository at this point in the history
The header being read has the format:

    <idnum> <generation> obj

where `<idnum>` and `<generation>` are integers.
Previously an arbitrary number of spaces was being allowed between `<idnum>` and `<generation>`, but not between `<generation>` and `obj`.
We now allow arbitrary spaces between `<generation>` and `obj`.
  • Loading branch information
malthejorgensen authored Jul 16, 2020
1 parent 18a2627 commit 5b3d04f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions PyPDF2/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,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)
obj = stream.read(3)
readNonWhitespace(stream)
stream.seek(-1, 1)
Expand Down

0 comments on commit 5b3d04f

Please sign in to comment.