Skip to content

Commit 84c04b0

Browse files
authored
Revert "Removed unused code" (#9185)
2 parents c000472 + abf088f commit 84c04b0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Tests/test_font_crash.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
import pytest
44

5-
from PIL import ImageFont
5+
from PIL import Image, ImageDraw, ImageFont
66

77
from .helper import skip_unless_feature
88

99

1010
class TestFontCrash:
1111
def _fuzz_font(self, font: ImageFont.FreeTypeFont) -> None:
12-
# from fuzzers.fuzz_font
12+
# Copy of the code from fuzz_font() in Tests/oss-fuzz/fuzzers.py
13+
# that triggered a problem when fuzzing
1314
font.getbbox("ABC")
1415
font.getmask("test text")
16+
with Image.new(mode="RGBA", size=(200, 200)) as im:
17+
draw = ImageDraw.Draw(im)
18+
draw.multiline_textbbox((10, 10), "ABC\nAaaa", font, stroke_width=2)
19+
draw.text((10, 10), "Test Text", font=font, fill="#000")
1520

1621
@skip_unless_feature("freetype2")
1722
def test_segfault(self) -> None:

0 commit comments

Comments
 (0)