Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: Source/platform/fonts/FontFallbackList.cpp

Issue 390183005: Avoid crash in FontFallbackList when LastResortFallbackFont is null (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontFallbackList.cpp
diff --git a/Source/platform/fonts/FontFallbackList.cpp b/Source/platform/fonts/FontFallbackList.cpp
index f9f004630885c255f550b7cdc55e1ba829f1bd72..05d9fd3f5071e45bbf21a8056904273046570225 100644
--- a/Source/platform/fonts/FontFallbackList.cpp
+++ b/Source/platform/fonts/FontFallbackList.cpp
@@ -139,10 +139,12 @@ const SimpleFontData* FontFallbackList::determinePrimarySimpleFontData(const Fon
if (!fontData) {
// All fonts are custom fonts and are loading. Return the first FontData.
fontData = fontDataAt(fontDescription, 0);
- if (!fontData)
- fontData = FontCache::fontCache()->getLastResortFallbackFont(fontDescription).get();
- ASSERT(fontData);
- return fontData->fontDataForCharacter(' ');
+ if (fontData)
+ return fontData->fontDataForCharacter(' ');
+
+ SimpleFontData* lastResortFallback = FontCache::fontCache()->getLastResortFallbackFont(fontDescription).get();
+ ASSERT(lastResortFallback);
+ return lastResortFallback;
}
if (fontData->isSegmented() && !toSegmentedFontData(fontData)->containsCharacter(' '))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698