diff --git a/Tests/images/sgi_crash.bin b/Tests/images/sgi_crash.bin new file mode 100644 index 000000000..9b138f6fe Binary files /dev/null and b/Tests/images/sgi_crash.bin differ diff --git a/Tests/images/sgi_overrun_expandrowF04.bin b/Tests/images/sgi_overrun_expandrowF04.bin new file mode 100644 index 000000000..1907d5d3d Binary files /dev/null and b/Tests/images/sgi_overrun_expandrowF04.bin differ diff --git a/Tests/test_sgi_crash.py b/Tests/test_sgi_crash.py new file mode 100644 index 000000000..984234be4 --- /dev/null +++ b/Tests/test_sgi_crash.py @@ -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()