Tests for SGI Overruns

This commit is contained in:
Eric Soroos 2020-03-28 13:19:27 +00:00 committed by Hugo
parent 394d6a180a
commit dd341f12d6
3 changed files with 15 additions and 0 deletions

BIN
Tests/images/sgi_crash.bin Normal file

Binary file not shown.

Binary file not shown.

15
Tests/test_sgi_crash.py Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
from .helper import PillowTestCase
from PIL import Image
repro = ('Tests/images/sgi_overrun_expandrowF04.bin',
'Tests/images/sgi_crash.bin',
)
class TestSgiCrashes(PillowTestCase):
def test_crashes(self):
for path in repro:
with open(path, 'rb') as f:
im = Image.open(f)
with self.assertRaises(IOError):
im.load()