mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 03:21:44 +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)
|
c = self.fp.read(1)
|
||||||
if not c or c in b_whitespace:
|
if not c or c in b_whitespace:
|
||||||
break
|
break
|
||||||
|
if c > b'\x79':
|
||||||
|
raise ValueError("Expected ASCII value, found binary")
|
||||||
s = s + c
|
s = s + c
|
||||||
|
if (len(s) > 9):
|
||||||
|
raise ValueError("Expected int, got > 9 digits")
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def _open(self):
|
def _open(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user