diff --git a/Tests/oss-fuzz/fuzz_imagecms.py b/Tests/oss-fuzz/fuzz_imagecms.py index f687c7054..07ca4e0a6 100755 --- a/Tests/oss-fuzz/fuzz_imagecms.py +++ b/Tests/oss-fuzz/fuzz_imagecms.py @@ -13,7 +13,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +from __future__ import annotations import atheris @@ -22,10 +22,31 @@ with atheris.instrument_imports(): import fuzzers -MODES = ["1", "L", "P", "RGB", "RGBA", "CMYK", "YCbCr", "LAB", - "HSV", "I", "F", "LA", "PA", "RGBX", "RGBa", "La", "I;16", - "I;16L", "I;16B", "I;16N", "BGR;15", "BGR;16", "BGR;24", - ] +MODES = [ + "1", + "L", + "P", + "RGB", + "RGBA", + "CMYK", + "YCbCr", + "LAB", + "HSV", + "I", + "F", + "LA", + "PA", + "RGBX", + "RGBa", + "La", + "I;16", + "I;16L", + "I;16B", + "I;16N", + "BGR;15", + "BGR;16", + "BGR;24", +] def TestOneInput(data: bytes) -> None: diff --git a/Tests/oss-fuzz/fuzzers.py b/Tests/oss-fuzz/fuzzers.py index fbaf253ab..0d7d79df1 100644 --- a/Tests/oss-fuzz/fuzzers.py +++ b/Tests/oss-fuzz/fuzzers.py @@ -3,7 +3,7 @@ from __future__ import annotations import io import warnings -from PIL import Image, ImageDraw, ImageFile, ImageFilter, ImageFont, ImageCms +from PIL import Image, ImageCms, ImageDraw, ImageFile, ImageFilter, ImageFont def enable_decompressionbomb_error() -> None: @@ -25,11 +25,13 @@ def fuzz_image(data: bytes) -> None: im.filter(ImageFilter.DETAIL) im.save(io.BytesIO(), "BMP") + def fuzz_cms(profile1, profile2, trans1, trans2) -> None: p1 = ImageCms.createProfile(profile1) p2 = ImageCms.createProfile(profile2) t = ImageCms.buildTransform(p1, p2, trans1, trans2) + def fuzz_font(data: bytes) -> None: wrapper = io.BytesIO(data) try: