mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-06 21:40:09 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
c8d0e9595e
commit
ea1919dadf
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user