Reviewed by Darin.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jan 2007 16:55:16 +0000 (16:55 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jan 2007 16:55:16 +0000 (16:55 +0000)
        - fix http://bugs.webkit.org/show_bug.cgi?id=12343
          crash in css2.1/t1202-counter-09-b.html

        * platform/Font.cpp:
        (WebCore::Font::glyphDataForCharacter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19009 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/Font.cpp

index 70f3bcd..5ebfb2a 100644 (file)
@@ -1,3 +1,13 @@
+2007-01-21  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=12343
+          crash in css2.1/t1202-counter-09-b.html
+
+        * platform/Font.cpp:
+        (WebCore::Font::glyphDataForCharacter):
+
 2007-01-21  Darin Adler  <darin@apple.com>
 
         Reviewed by Adam and Mitz.
index 4afafc5..408482d 100644 (file)
@@ -401,8 +401,8 @@ const GlyphData& Font::glyphDataForCharacter(UChar32 c, const UChar* cluster, un
             if (smallCaps)
                 characterFontData = characterFontData->smallCapsFontData(m_fontDescription);
             if (characterFontData) {
-                GlyphPageTreeNode* fallbackNode = GlyphPageTreeNode::getRootChild(characterFontData, pageNumber);
-                const GlyphData& data = fallbackNode->page()->glyphDataForCharacter(c);
+                GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData, pageNumber)->page();
+                const GlyphData& data = fallbackPage ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
                 if (!smallCaps)
                     page->setGlyphDataForCharacter(c, data.glyph, characterFontData);
                 return data;