Bug 1458003 - speculative fix: make a local copy of the face list in CheckForLegacyFamilyNames, in case mAvailableFonts is mutated during this function. r=lsalzman

This commit is contained in:
Jonathan Kew 2018-05-08 20:54:02 +01:00
Родитель 734a1bb77d
Коммит e6b971d44f
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -2003,7 +2003,10 @@ gfxFontFamily::CheckForLegacyFamilyNames(gfxPlatformFontList* aFontList)
mCheckedForLegacyFamilyNames = true;
bool added = false;
const uint32_t kNAME = TRUETYPE_TAG('n','a','m','e');
for (auto& fe : mAvailableFonts) {
// Make a local copy of the array of font faces, in case of changes
// during the iteration.
AutoTArray<RefPtr<gfxFontEntry>,8> faces(mAvailableFonts);
for (auto& fe : faces) {
if (!fe) {
continue;
}