Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim glyph size in ImageFont.getmask() #7669

Merged
merged 5 commits into from
Jan 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added decompression bomb check to ImageFont.getmask()
  • Loading branch information
radarhere committed Jan 1, 2024
commit af026fdd3ce08c4865467fe3343dc8d7360af8da
1 change: 1 addition & 0 deletions src/PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def getmask(self, text, mode="", *args, **kwargs):
:py:mod:`PIL.Image.core` interface module.
"""
_string_length_check(text)
Image._decompression_bomb_check(self.font.getsize(text))
return self.font.getmask(text, mode)

def getbbox(self, text, *args, **kwargs):
Expand Down