mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 09:56:17 +03:00
sanity check on ascii integers
This commit is contained in:
parent
213cec00cb
commit
88e235f3f5
|
@ -63,7 +63,11 @@ class PpmImageFile(ImageFile.ImageFile):
|
|||
c = self.fp.read(1)
|
||||
if not c or c in b_whitespace:
|
||||
break
|
||||
if c > b'\x79':
|
||||
raise ValueError("Expected ASCII value, found binary")
|
||||
s = s + c
|
||||
if (len(s) > 9):
|
||||
raise ValueError("Expected int, got > 9 digits")
|
||||
return s
|
||||
|
||||
def _open(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user