) [8,8 100x51] overflow: [8,8 133.921875x51]
- PaintableWithLines (BlockContainer
) [8,8 114.265625x17]
+ PaintableWithLines (BlockContainer) [8,8 100x51] overflow: [8,8 139.765625x51]
+ PaintableWithLines (BlockContainer) [8,8 120.109375x17]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer) [8,25 123.609375x17]
+ PaintableWithLines (BlockContainer) [8,25 129.453125x17]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer) [8,42 133.921875x17]
+ PaintableWithLines (BlockContainer) [8,42 139.765625x17]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,59 784x0]
diff --git a/Tests/LibWeb/Text/expected/regress/recursive-glyph-miscount-dont-crash.txt b/Tests/LibWeb/Text/expected/regress/recursive-glyph-miscount-dont-crash.txt
new file mode 100644
index 00000000000..aaecaf93c4a
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/regress/recursive-glyph-miscount-dont-crash.txt
@@ -0,0 +1 @@
+PASS (didn't crash)
diff --git a/Tests/LibWeb/Text/input/regress/recursive-glyph-miscount-dont-crash.html b/Tests/LibWeb/Text/input/regress/recursive-glyph-miscount-dont-crash.html
new file mode 100644
index 00000000000..b3d36bdfc1c
--- /dev/null
+++ b/Tests/LibWeb/Text/input/regress/recursive-glyph-miscount-dont-crash.html
@@ -0,0 +1,7 @@
+
+≠
+
diff --git a/Userland/Libraries/LibGfx/TextLayout.cpp b/Userland/Libraries/LibGfx/TextLayout.cpp
index f3f4a4d70ea..ce8e4ddfa58 100644
--- a/Userland/Libraries/LibGfx/TextLayout.cpp
+++ b/Userland/Libraries/LibGfx/TextLayout.cpp
@@ -21,7 +21,6 @@ RefPtr shape_text(FloatPoint baseline_start, Utf8View string, Gfx::Fon
u32 glyph_count;
auto* glyph_info = hb_buffer_get_glyph_infos(buffer, &glyph_count);
- Vector const input_glyph_info({ glyph_info, glyph_count });
auto* hb_font = font.harfbuzz_font();
hb_shape(hb_font, buffer, nullptr, 0);
@@ -29,6 +28,7 @@ RefPtr shape_text(FloatPoint baseline_start, Utf8View string, Gfx::Fon
glyph_info = hb_buffer_get_glyph_infos(buffer, &glyph_count);
auto* positions = hb_buffer_get_glyph_positions(buffer, &glyph_count);
+ Vector const input_glyph_info({ glyph_info, glyph_count });
Vector glyph_run;
FloatPoint point = baseline_start;
for (size_t i = 0; i < glyph_count; ++i) {