Pillow/Tests/test_sgi_crash.py

16 lines
339 B
Python
Raw Normal View History

2020-03-28 16:19:27 +03:00
#!/usr/bin/env python
2020-04-01 10:19:15 +03:00
import pytest
2020-03-28 16:19:27 +03:00
from PIL import Image
2020-04-01 10:13:12 +03:00
2020-04-01 10:19:15 +03:00
@pytest.mark.parametrize(
"test_file",
["Tests/images/sgi_overrun_expandrowF04.bin", "Tests/images/sgi_crash.bin"],
2020-04-01 10:13:12 +03:00
)
2020-04-01 10:19:15 +03:00
def test_crashes(test_file):
with open(test_file, "rb") as f:
im = Image.open(f)
with pytest.raises(OSError):
2020-04-01 10:19:15 +03:00
im.load()