Pillow/Tests/test_sgi_crash.py

21 lines
490 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",
"Tests/images/crash-6b7f2244da6d0ae297ee0754a424213444e92778.sgi",
"Tests/images/ossfuzz-5730089102868480.sgi",
],
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()