Skip to content

Commit 020f890

Browse files
committed
add a selection of test cases from oss-fuzz
1 parent f15886a commit 020f890

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Tests/test_file_dds.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
assert_image_similar,
1616
assert_image_similar_tofile,
1717
hopper,
18+
timeout_unless_slower_valgrind,
1819
)
1920

2021
TEST_FILE_DXT1 = "Tests/images/dxt1-rgb-4bbp-noalpha_MipMaps-1.dds"
@@ -540,3 +541,18 @@ def test_save_large_file(tmp_path: Path, pixel_format: str, mode: str) -> None:
540541
im = hopper(mode).resize((440, 440))
541542
# should not error in valgrind
542543
im.save(tmp_path / "img.dds", pixel_format=pixel_format)
544+
545+
546+
@timeout_unless_slower_valgrind(1)
547+
@pytest.mark.parametrize(
548+
"test_file",
549+
[
550+
"Tests/images/timeout-041dd17dfde800360a47a172269df127af138c6b.dds",
551+
"Tests/images/timeout-755a4d204f4208e3597ac3391edebee196462bd0.dds",
552+
"Tests/images/timeout-52d106579505547091ef69b58341351a37c23e31.dds",
553+
"Tests/images/timeout-c60a3d7314213624607bfb3e38d551a8b24a7435.dds",
554+
],
555+
)
556+
def test_timeout(test_file) -> None:
557+
with Image.open(test_file) as im:
558+
im.load()

0 commit comments

Comments
 (0)