Skip to content

Commit

Permalink
Close existing fp before setting new fp
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 8, 2018
1 parent 83216b9 commit 7ecf9f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PIL/WebPImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def load(self):
self.__loaded = self.__logical_frame

# Set tile
if self.fp:
self.fp.close()
self.fp = BytesIO(data)
self.tile = [("raw", (0, 0) + self.size, 0, self.mode)]

Expand Down

0 comments on commit 7ecf9f6

Please sign in to comment.