diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 30f6694e6cd..b08f107907e 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -767,18 +767,19 @@ def getmask2( offset = offset[0] - stroke_width, offset[1] - stroke_width Image._decompression_bomb_check(size) im = fill("RGBA" if mode == "RGBA" else "L", size, 0) - self.font.render( - text, - im.id, - mode, - direction, - features, - language, - stroke_width, - ink, - start[0], - start[1], - ) + if min(size): + self.font.render( + text, + im.id, + mode, + direction, + features, + language, + stroke_width, + ink, + start[0], + start[1], + ) return im, offset def font_variant(