Commit 36ebc02c authored by mitz@apple.com's avatar mitz@apple.com
Browse files

Reviewed by Dave Hyatt.

        - fix https://bugs.webkit.org/show_bug.cgi?id=18352
          <rdar://problem/5854517> crash loading malicious font

        * platform/graphics/mac/SimpleFontDataMac.mm:
        (WebCore::SimpleFontData::platformInit): In the case of a custom font,
        there is no NSFont to base the fallback font on, so get a font based on
        fallback family name alone.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f8aef678
2008-05-21 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
- fix https://bugs.webkit.org/show_bug.cgi?id=18352
<rdar://problem/5854517> crash loading malicious font
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit): In the case of a custom font,
there is no NSFont to base the fallback font on, so get a font based on
fallback family name alone.
2008-05-21 Timothy Hatcher <timothy@apple.com>
 
Adds the files and line numbers to the Profile call tree.
......@@ -169,7 +169,10 @@ void SimpleFontData::platformInit()
#if !ERROR_DISABLED
RetainPtr<NSFont> initialFont = m_font.font();
#endif
m_font.setFont([[NSFontManager sharedFontManager] convertFont:m_font.font() toFamily:fallbackFontFamily]);
if (m_font.font())
m_font.setFont([[NSFontManager sharedFontManager] convertFont:m_font.font() toFamily:fallbackFontFamily]);
else
m_font.setFont([NSFont fontWithName:fallbackFontFamily size:m_font.size()]);
#if !ERROR_DISABLED
NSString *filePath = pathFromFont(initialFont.get());
if (!filePath)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment