Index: src/utils/SkWhitelistTypefaces.cpp |
diff --git a/src/utils/SkWhitelistTypefaces.cpp b/src/utils/SkWhitelistTypefaces.cpp |
index d3ffe98d16c052f95630ae0058512637008cdb9d..66d32188a023e69bfa9fc27fd8c47f933ad5eda6 100644 |
--- a/src/utils/SkWhitelistTypefaces.cpp |
+++ b/src/utils/SkWhitelistTypefaces.cpp |
@@ -184,7 +184,11 @@ void WhitelistSerializeTypeface(const SkTypeface* tf, SkWStream* wstream) { |
} |
SkTypeface* WhitelistDeserializeTypeface(SkStream* stream) { |
- SkFontDescriptor desc(stream); |
+ SkFontDescriptor desc; |
+ if (!SkFontDescriptor::Deserialize(stream, &desc)) { |
+ return nullptr; |
+ } |
+ |
SkFontData* data = desc.detachFontData(); |
if (data) { |
SkTypeface* typeface = SkTypeface::CreateFromFontData(data); |