Skip to content

Commit

Permalink
BUG: Fix ASCII85Decode.decode assertion (#729)
Browse files Browse the repository at this point in the history
BUG: Off-by-one
FIX: Set 2**32-1 inclusive

Closes #312

Credits to Michael Sander (speedplane) who
included it here:
#333
  • Loading branch information
MartinThoma authored Apr 10, 2022
1 parent a96bc3c commit 8f8e0ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def decode(data, decodeParms=None):
group[2] * (85**2) + \
group[3] * 85 + \
group[4]
assert b < (2**32 - 1)
assert b <= (2**32 - 1)
c4 = chr((b >> 0) % 256)
c3 = chr((b >> 8) % 256)
c2 = chr((b >> 16) % 256)
Expand Down

0 comments on commit 8f8e0ae

Please sign in to comment.