From 7672f932f752d9d925b0915b291d2099f894bb45 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 21 May 2024 14:10:27 +0200 Subject: [PATCH] [gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created. --- gfx/thebes/gfxFont.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 383cc19042..9c3cf6a3d1 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -860,6 +860,10 @@ gfxFont::gfxFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle, ++gFontCount; #endif mKerningSet = HasFeatureSet(HB_TAG('k','e','r','n'), mKerningEnabled); + + // Ensure the gfxFontEntry's unitsPerEm and extents fields are initialized, + // so that GetFontExtents can use them without risk of races. + Unused << mFontEntry->UnitsPerEm(); } gfxFont::~gfxFont()