Bug 1717595 - Ensure we check the fontgroup's validity before using it to build a textrun or otherwise access its cached font instances. r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D118733
This commit is contained in:
Jonathan Kew 2021-06-25 10:14:17 +00:00
parent e1bb171944
commit a0abb0f180
2 changed files with 6 additions and 0 deletions

View File

@ -2248,6 +2248,9 @@ gfxFont* gfxFontGroup::GetDefaultFont() {
gfxFont* gfxFontGroup::GetFirstValidFont(uint32_t aCh,
StyleGenericFontFamily* aGeneric) {
// Ensure cached font instances are valid.
CheckForUpdatedPlatformList();
uint32_t count = mFonts.Length();
bool loading = false;
for (uint32_t i = 0; i < count; ++i) {

View File

@ -516,6 +516,9 @@ void MathMLTextRunFactory::RebuildTextRun(
uint8_t mathVar = NS_MATHML_MATHVARIANT_NONE;
bool doMathvariantStyling = true;
// Ensure it will be safe to call FindFontForChar in the loop below.
fontGroup->CheckForUpdatedPlatformList();
for (uint32_t i = 0; i < length; ++i) {
int extraChars = 0;
mathVar = styles[i]->mMathVariant;