Changeset 119340 in webkit


Ignore:
Timestamp:
Jun 2, 2012 2:52:29 PM (12 years ago)
Author:
efidler@rim.com
Message:

Don't crash if we ask for fonts that don't exist.
https://bugs.webkit.org/show_bug.cgi?id=88106

Reviewed by Dan Bernstein.

RIM PR 161219

If the site doesn't ask for a reasonable font and the system doesn't
provide a good fallback, FontFallBackList::primaryFontData can be 0,
which can cause a crash.

  • platform/graphics/skia/FontCacheSkia.cpp:

(WebCore::FontCache::getLastResortFallbackFont):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r119330 r119340  
     12012-06-02  Eli Fidler  <efidler@rim.com>
     2
     3        Don't crash if we ask for fonts that don't exist.
     4        https://bugs.webkit.org/show_bug.cgi?id=88106
     5
     6        Reviewed by Dan Bernstein.
     7
     8        RIM PR 161219
     9
     10        If the site doesn't ask for a reasonable font and the system doesn't
     11        provide a good fallback, FontFallBackList::primaryFontData can be 0,
     12        which can cause a crash.
     13
     14        * platform/graphics/skia/FontCacheSkia.cpp:
     15        (WebCore::FontCache::getLastResortFallbackFont):
     16
    1172012-06-02  Kentaro Hara  <haraken@chromium.org>
    218
  • trunk/Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp

    r103742 r119340  
    116116    }
    117117
     118    if (!fontPlatformData) {
     119        // we should at least have Arial; this is the SkFontHost_fontconfig last resort fallback
     120        DEFINE_STATIC_LOCAL(const AtomicString, arialStr, ("Arial"));
     121        fontPlatformData = getCachedFontPlatformData(description, arialStr);
     122    }
     123
    118124    ASSERT(fontPlatformData);
    119125    return getCachedFontData(fontPlatformData, shouldRetain);
Note: See TracChangeset for help on using the changeset viewer.