mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
SpiderImagePlugin: raise an error when seeking in a non-stack file
Using ImageSequence.Iterator on a non-stack SPIDER image leads to infinite loop. EOFError (which stops the iteration) is never raised because when the image isn't a stack, seek() returns gently without error.
This commit is contained in:
parent
fd7fa4e61d
commit
d07ab52c66
|
@ -173,7 +173,7 @@ class SpiderImageFile(ImageFile.ImageFile):
|
|||
|
||||
def seek(self, frame):
|
||||
if self.istack == 0:
|
||||
return
|
||||
raise EOFError("attempt to seek in a non-stack file")
|
||||
if frame >= self._nimages:
|
||||
raise EOFError("attempt to seek past end of file")
|
||||
self.stkoffset = self.hdrlen + frame * (self.hdrlen + self.imgbytes)
|
||||
|
|
Loading…
Reference in New Issue
Block a user