mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Merge pull request #6897 from radarhere/eps
Stop reading when EPS line becomes too long
This commit is contained in:
commit
876b9f4ec8
|
@ -173,11 +173,13 @@ class PSFile:
|
|||
self.fp.seek(offset, whence)
|
||||
|
||||
def readline(self):
|
||||
s = [self.char or b""]
|
||||
self.char = None
|
||||
s = []
|
||||
if self.char:
|
||||
s.append(self.char)
|
||||
self.char = None
|
||||
|
||||
c = self.fp.read(1)
|
||||
while (c not in b"\r\n") and len(c):
|
||||
while (c not in b"\r\n") and len(c) and len(b"".join(s).strip(b"\r\n")) <= 255:
|
||||
s.append(c)
|
||||
c = self.fp.read(1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user