[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-02-10 22:04:56 +00:00
parent c8d0e9595e
commit ea1919dadf
2 changed files with 29 additions and 6 deletions

View File

@ -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,9 +22,30 @@ 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",
]

View File

@ -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: