Skip to content

Commit

Permalink
Merge remote-tracking branch 'myfork/bugfix/530' into bugfix/pypdf3/530
Browse files Browse the repository at this point in the history
  • Loading branch information
vashek committed May 12, 2021
2 parents 9be529f + 4ce480f commit a42939f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PyPDF3/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,15 @@ def used_before(num, generation):
else:
break
else:
# some PDFs have /Prev=0 in the trailer, instead of no /Prev
if startxref == 0:
if self.strict:
raise utils.PdfReadError("/Prev=0 in the trailer (try"
" opening with strict=False)")
else:
warnings.warn("/Prev=0 in the trailer - assuming there"
" is no previous xref table")
break
# bad xref character at startxref. Let's see if we can find
# the xref table nearby, as we've observed this error with an
# off-by-one before.
Expand Down

0 comments on commit a42939f

Please sign in to comment.