mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-25 22:54:46 +03:00
FIX: fix PngImageFile.load_end
Ensure that the flow-control EOFError exceptions are properly handled. closes #3527
This commit is contained in:
parent
41fba67fb0
commit
7436501a2a
|
@ -677,6 +677,11 @@ class PngImageFile(ImageFile.ImageFile):
|
||||||
self.png.call(cid, pos, length)
|
self.png.call(cid, pos, length)
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
break
|
break
|
||||||
|
except EOFError:
|
||||||
|
# call dispatches out to chunk_* methods which
|
||||||
|
# mutate the internal state and then raise EOFError
|
||||||
|
# for a chunk that must be last.
|
||||||
|
break
|
||||||
self._text = self.png.im_text
|
self._text = self.png.im_text
|
||||||
self.png.close()
|
self.png.close()
|
||||||
self.png = None
|
self.png = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user