Title: [204154] trunk/Source/WebCore
Revision
204154
Author
mcatanz...@igalia.com
Date
2016-08-04 17:20:48 -0700 (Thu, 04 Aug 2016)

Log Message

[Fontconfig] Segmentation fault in WebCore::FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=141432

Reviewed by Myles C. Maxfield.

Crash more cleanly when we can't find any last resort fallback font.

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::lastResortFallbackFont):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (204153 => 204154)


--- trunk/Source/WebCore/ChangeLog	2016-08-04 23:49:42 UTC (rev 204153)
+++ trunk/Source/WebCore/ChangeLog	2016-08-05 00:20:48 UTC (rev 204154)
@@ -1,3 +1,15 @@
+2016-08-04  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        [Fontconfig] Segmentation fault in WebCore::FontCache::lastResortFallbackFont
+        https://bugs.webkit.org/show_bug.cgi?id=141432
+
+        Reviewed by Myles C. Maxfield.
+
+        Crash more cleanly when we can't find any last resort fallback font.
+
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::FontCache::lastResortFallbackFont):
+
 2016-08-04  Chris Dumez  <cdu...@apple.com>
 
         Move insertAdjacent*() API from HTMLElement to Element

Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (204153 => 204154)


--- trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp	2016-08-04 23:49:42 UTC (rev 204153)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp	2016-08-05 00:20:48 UTC (rev 204154)
@@ -126,7 +126,11 @@
     // We want to return a fallback font here, otherwise the logic preventing FontConfig
     // matches for non-fallback fonts might return 0. See isFallbackFontAllowed.
     static AtomicString timesStr("serif");
-    return *fontForFamily(fontDescription, timesStr);
+    if (RefPtr<Font> font = fontForFamily(fontDescription, timesStr))
+        return *font;
+
+    // This could be reached due to improperly-installed or misconfigured fontconfig.
+    RELEASE_ASSERT_NOT_REACHED();
 }
 
 Vector<FontTraitsMask> FontCache::getTraitsInFamily(const AtomicString&)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to