mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-26 22:16:59 +03:00
Add decompression bomb warning for Image.new() (re: #771)
This commit is contained in:
parent
ff668ae54e
commit
48e12e04de
|
@ -1985,6 +1985,8 @@ def new(mode, size, color=0):
|
||||||
:returns: An :py:class:`~PIL.Image.Image` object.
|
:returns: An :py:class:`~PIL.Image.Image` object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
_decompression_bomb_check(size)
|
||||||
|
|
||||||
if color is None:
|
if color is None:
|
||||||
# don't initialize
|
# don't initialize
|
||||||
return Image()._new(core.new(mode, size))
|
return Image()._new(core.new(mode, size))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user