mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00: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
Notes:
github-actions[bot]
2025-10-03 07:23:27 +00:00
Author: https://github.com/Zaggy1024
Commit: 1ae7ecc3e9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6376
Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 0 deletions
|
@ -191,6 +191,7 @@ float measure_text_width(Utf16View const& string, Font const& font, ShapeFeature
|
|||
for (size_t i = 0; i < glyph_count; ++i)
|
||||
point_x += positions[i].x_advance;
|
||||
|
||||
hb_buffer_destroy(buffer);
|
||||
return point_x / text_shaping_resolution;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue