From 48e12e04de8cf8244e0793ae01b0f461d87de904 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sat, 5 Jul 2014 21:55:59 +0300 Subject: [PATCH] Add decompression bomb warning for Image.new() (re: #771) --- PIL/Image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PIL/Image.py b/PIL/Image.py index 787e60270..551c23c29 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -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))