mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Reset fuzzer LOAD_TRUNCATED_IMAGES and filters to allow for random test order
This commit is contained in:
parent
d99a6ff862
commit
41fc39174a
|
@ -34,6 +34,7 @@ def main():
|
|||
fuzzers.enable_decompressionbomb_error()
|
||||
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
|
||||
atheris.Fuzz()
|
||||
fuzzers.disable_decompressionbomb_error()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -34,6 +34,7 @@ def main():
|
|||
fuzzers.enable_decompressionbomb_error()
|
||||
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
|
||||
atheris.Fuzz()
|
||||
fuzzers.disable_decompressionbomb_error()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -10,6 +10,11 @@ def enable_decompressionbomb_error():
|
|||
warnings.simplefilter("error", Image.DecompressionBombWarning)
|
||||
|
||||
|
||||
def disable_decompressionbomb_error():
|
||||
ImageFile.LOAD_TRUNCATED_IMAGES = False
|
||||
warnings.resetwarnings()
|
||||
|
||||
|
||||
def fuzz_image(data):
|
||||
# This will fail on some images in the corpus, as we have many
|
||||
# invalid images in the test suite.
|
||||
|
|
|
@ -44,6 +44,8 @@ def test_fuzz_images(path):
|
|||
):
|
||||
# Known Image.* exceptions
|
||||
assert True
|
||||
finally:
|
||||
fuzzers.disable_decompressionbomb_error()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
Loading…
Reference in New Issue
Block a user