From e6e5bb32431d61146403e001c93df90ff09b720b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 8 Jan 2025 18:12:10 +1100 Subject: [PATCH] abort --- Tests/oss-fuzz/fuzzers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/oss-fuzz/fuzzers.py b/Tests/oss-fuzz/fuzzers.py index 0b9e30cb6ae..93947b9adef 100644 --- a/Tests/oss-fuzz/fuzzers.py +++ b/Tests/oss-fuzz/fuzzers.py @@ -21,6 +21,10 @@ def fuzz_image(data: bytes) -> None: # This will fail on some images in the corpus, as we have many # invalid images in the test suite. print("torch", ImageFile.LOAD_TRUNCATED_IMAGES) + if ImageFile.LOAD_TRUNCATED_IMAGES: + print("torchabort") + import sys + sys.exit() with Image.open(io.BytesIO(data)) as im: im.rotate(45) im.filter(ImageFilter.DETAIL)