From 682b8978d231f7e7c1d9724a1327a46c005c49ee Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Thu, 10 Sep 2009 13:57:27 -0700 Subject: [PATCH] b=513192; Crash [@nsAString_internal::BeginReading(nsReadingIterator&)]; r=jfkthame --- gfx/thebes/src/gfxWindowsPlatform.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/src/gfxWindowsPlatform.cpp b/gfx/thebes/src/gfxWindowsPlatform.cpp index c645b325e138..20c2ea033390 100644 --- a/gfx/thebes/src/gfxWindowsPlatform.cpp +++ b/gfx/thebes/src/gfxWindowsPlatform.cpp @@ -620,7 +620,11 @@ gfxWindowsPlatform::FindFontForCharProc(nsStringHashKey::KeyType aKey, if (!fe) return PL_DHASH_NEXT; - PRInt32 rank = 0; + // initialize rank to 1 so that any match is better than the initial + // value of data->mMatchRank (zero); therefore the first font that + // passes the mCharacterMap.test() will become the mBestMatch until + // a better entry is found + PRInt32 rank = 1; // skip over non-unicode and bitmap fonts and fonts that don't have // the code point we're looking for