Index: Source/WebCore/platform/graphics/mac/FontCacheMac.mm |
=================================================================== |
--- Source/WebCore/platform/graphics/mac/FontCacheMac.mm (revision 113809) |
+++ Source/WebCore/platform/graphics/mac/FontCacheMac.mm (working copy) |
@@ -230,7 +230,12 @@ |
bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight); |
bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait); |
- return new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.textOrientation(), fontDescription.widthVariant()); |
+ // FontPlatformData::font() can be null for the case of Chromium out-of-process font loading. |
+ // In that case, we don't want to use the platformData. |
+ OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.textOrientation(), fontDescription.widthVariant())); |
+ if (!platformData->font()) |
+ return 0; |
+ return platformData.leakPtr(); |
} |
} // namespace WebCore |