Index: src/core/SkTypeface.cpp |
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp |
index e6a9b4d66cd0f71988cb24e8eb840022ca9316d3..8d4233eac14d62921dba471c6a1a24e4ec0bb9ff 100644 |
--- a/src/core/SkTypeface.cpp |
+++ b/src/core/SkTypeface.cpp |
@@ -180,7 +180,12 @@ SkTypeface* SkTypeface::Deserialize(SkStream* stream) { |
if (gDeserializeTypefaceDelegate) { |
return (*gDeserializeTypefaceDelegate)(stream); |
} |
- SkFontDescriptor desc(stream); |
+ |
+ SkFontDescriptor desc; |
+ if (!SkFontDescriptor::Deserialize(stream, &desc)) { |
+ return nullptr; |
+ } |
+ |
SkFontData* data = desc.detachFontData(); |
if (data) { |
SkTypeface* typeface = SkTypeface::CreateFromFontData(data); |