Added decompression bomb check to ImageFont.getmask()

This commit is contained in:
Andrew Murray 2024-01-01 16:06:09 +11:00
parent d6fd4c978e
commit af026fdd3c

View File

@ -150,6 +150,7 @@ class ImageFont:
:py:mod:`PIL.Image.core` interface module. :py:mod:`PIL.Image.core` interface module.
""" """
_string_length_check(text) _string_length_check(text)
Image._decompression_bomb_check(self.font.getsize(text))
return self.font.getmask(text, mode) return self.font.getmask(text, mode)
def getbbox(self, text, *args, **kwargs): def getbbox(self, text, *args, **kwargs):