We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d5a2d2 commit e3b53dcCopy full SHA for e3b53dc
src/PIL/PpmImagePlugin.py
@@ -141,7 +141,7 @@ class PpmPlainDecoder(ImageFile.PyDecoder):
141
_pulls_fd = True
142
143
def _read_block(self):
144
- return self.fd.read(10**6)
+ return self.fd.read(ImageFile.SAFEBLOCK)
145
146
def _find_comment_end(self, block, start=0):
147
a = block.find(b"\n", start)
@@ -186,8 +186,8 @@ def _decode_bitonal(self):
186
while block and comment_spans:
187
comment_end = self._find_comment_end(block)
188
if comment_end != -1: # comment ends in this block
189
- comment_spans = False
190
block = block[comment_end + 1 :] # delete tail of previous comment
+ comment_spans = False
191
else: # comment spans whole block
192
block = self._read_block()
193
0 commit comments