mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibAccelGfx: Fix stack use after scope in GlyphAtlas::update()
This commit is contained in:
parent
36f0499cc8
commit
38d62563b3
Notes:
sideshowbarker
2024-07-17 18:23:22 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/38d62563b3 Pull-request: https://github.com/SerenityOS/serenity/pull/22341
1 changed files with 3 additions and 3 deletions
|
@ -45,8 +45,8 @@ void GlyphAtlas::update(HashMap<Gfx::Font const*, HashTable<u32>> const& unique_
|
|||
glyphs_sorted_by_height.append(atlas_key);
|
||||
}
|
||||
quick_sort(glyphs_sorted_by_height, [&](auto const& a, auto const& b) {
|
||||
auto const& bitmap_a = *glyph_bitmaps.get(a);
|
||||
auto const& bitmap_b = *glyph_bitmaps.get(b);
|
||||
auto const* bitmap_a = *glyph_bitmaps.get(a);
|
||||
auto const* bitmap_b = *glyph_bitmaps.get(b);
|
||||
return bitmap_a->height() > bitmap_b->height();
|
||||
});
|
||||
|
||||
|
@ -56,7 +56,7 @@ void GlyphAtlas::update(HashMap<Gfx::Font const*, HashTable<u32>> const& unique_
|
|||
int const texture_width = 512;
|
||||
int const padding = 1;
|
||||
for (auto const& glyphs_texture_key : glyphs_sorted_by_height) {
|
||||
auto const& bitmap = *glyph_bitmaps.get(glyphs_texture_key);
|
||||
auto const* bitmap = *glyph_bitmaps.get(glyphs_texture_key);
|
||||
if (current_x + bitmap->width() > texture_width) {
|
||||
current_x = 0;
|
||||
current_y += row_height + padding;
|
||||
|
|
Loading…
Reference in a new issue