Bug 524462. Fix startup crash in pref fonts with funky cmaps. r=jdaggett
authorBas Schouten
Fri, 30 Oct 2009 16:41:13 -0600
changeset 34423 0eb54d1ad4e05cb6a6b35eb46f58d03bf90da72f
parent 34422 19a209a691be40817eee49481e8297203c3aed28
child 34424 4c9a699ca7cb18366eab49ed6425a8807676d2f6
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs524462
milestone1.9.3a1pre
Bug 524462. Fix startup crash in pref fonts with funky cmaps. r=jdaggett
gfx/thebes/src/gfxWindowsFonts.cpp
--- a/gfx/thebes/src/gfxWindowsFonts.cpp
+++ b/gfx/thebes/src/gfxWindowsFonts.cpp
@@ -1318,17 +1318,19 @@ gfxWindowsFontGroup::FamilyListToArrayLi
 {
     nsAutoTArray<nsString, 15> fonts;
     ForEachFont(aFamilies, aLangGroup, AddFontNameToArray, &fonts);
 
     PRUint32 len = fonts.Length();
     for (PRUint32 i = 0; i < len; ++i) {
         const nsString& str = fonts[i];
         nsRefPtr<FontEntry> fe = gfxWindowsPlatform::GetPlatform()->FindFontEntry(str, mStyle);
-        list->AppendElement(fe);
+        if (fe) {
+            list->AppendElement(fe);
+        }
     }
 }
 
 gfxWindowsFontGroup::gfxWindowsFontGroup(const nsAString& aFamilies, const gfxFontStyle *aStyle, gfxUserFontSet *aUserFontSet)
     : gfxFontGroup(aFamilies, aStyle, aUserFontSet)
 {
     InitFontList();
 }