mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
Catch OverflowError in SpiderImagePlugin
This commit is contained in:
parent
6cacfc8909
commit
4d7b630b33
|
@ -50,6 +50,8 @@ def isInt(f):
|
||||||
return 0
|
return 0
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return 0
|
return 0
|
||||||
|
except OverflowError:
|
||||||
|
return 0
|
||||||
|
|
||||||
iforms = [1, 3, -11, -12, -21, -22]
|
iforms = [1, 3, -11, -12, -21, -22]
|
||||||
|
|
||||||
|
|
BIN
Tests/images/invalid.spider
Normal file
BIN
Tests/images/invalid.spider
Normal file
Binary file not shown.
|
@ -80,6 +80,11 @@ class TestImageSpider(PillowTestCase):
|
||||||
# Assert
|
# Assert
|
||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
|
|
||||||
|
def test_invalid_file(self):
|
||||||
|
invalid_file = "Tests/images/invalid.spider"
|
||||||
|
|
||||||
|
self.assertRaises(IOError, lambda: Image.open(invalid_file))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user