mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
d50445ff30
Similar to the recent adoption of Black. isort is a Python utility to sort imports alphabetically and automatically separate into sections. By using isort, contributors can quickly and automatically conform to the projects style without thinking. Just let the tool do it. Uses the configuration recommended by the Black to avoid conflicts of style. Rewrite TestImageQt.test_deprecated to no rely on import order.
13 lines
355 B
Python
13 lines
355 B
Python
# Tests potential DOS of IcnsImagePlugin with 0 length block.
|
|
# Run from anywhere that PIL is importable.
|
|
|
|
from io import BytesIO
|
|
|
|
from PIL import Image
|
|
from PIL._util import py3
|
|
|
|
if py3:
|
|
Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00", "latin-1")))
|
|
else:
|
|
Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00")))
|