Add decompression bomb warning for Image.new() (re: #771)

This commit is contained in:
hugovk 2014-07-05 21:55:59 +03:00
parent ff668ae54e
commit 48e12e04de

View File

@ -1985,6 +1985,8 @@ def new(mode, size, color=0):
:returns: An :py:class:`~PIL.Image.Image` object.
"""
_decompression_bomb_check(size)
if color is None:
# don't initialize
return Image()._new(core.new(mode, size))