mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibGfx: Free the harfbuzz buffer when measuring text width
I spotted this leak when WebContent was exiting with ASan enabled on a page with a media element. MediaPaintable calls Gfx::Font::width(), which calls through to measure_text_width(), which then drops an hb_buffer_t* without freeing it.
This commit is contained in:
parent
400300945f
commit
1ae7ecc3e9
|
|
@ -191,6 +191,7 @@ float measure_text_width(Utf16View const& string, Font const& font, ShapeFeature
|
||||||
for (size_t i = 0; i < glyph_count; ++i)
|
for (size_t i = 0; i < glyph_count; ++i)
|
||||||
point_x += positions[i].x_advance;
|
point_x += positions[i].x_advance;
|
||||||
|
|
||||||
|
hb_buffer_destroy(buffer);
|
||||||
return point_x / text_shaping_resolution;
|
return point_x / text_shaping_resolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user