Esempio n. 1
0
def TestOneInput(data):
    try:
        fuzzers.fuzz_font(data)
    except Exception:
        # We're catching all exceptions because Pillow's exceptions are
        # directly inheriting from Exception.
        pass
Esempio n. 2
0
def test_fuzz_fonts(path):
    if not path:
        return
    with open(path, "rb") as f:
        try:
            fuzzers.fuzz_font(f.read())
        except (Image.DecompressionBombError, Image.DecompressionBombWarning):
            pass
        assert True
Esempio n. 3
0
def test_fuzz_fonts(path):
    if not path or b"LICENSE.txt" in path or b".pil" in path:
        return
    with open(path, "rb") as f:
        fuzzers.fuzz_font(f.read())
        assert True