Merge pull request #1545 from radarhere/overflow

Catch OverflowError in SpiderImagePlugin
This commit is contained in:
wiredfool 2015-11-18 09:28:58 +00:00
commit 3f0f370a79
3 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,8 @@ def isInt(f):
return 0
except ValueError:
return 0
except OverflowError:
return 0
iforms = [1, 3, -11, -12, -21, -22]

BIN
Tests/images/invalid.spider Normal file

Binary file not shown.

View File

@ -80,6 +80,11 @@ class TestImageSpider(PillowTestCase):
# Assert
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__':
unittest.main()