Index: src/sfnt/SkOTUtils.cpp |
diff --git a/src/sfnt/SkOTUtils.cpp b/src/sfnt/SkOTUtils.cpp |
index e76d1da08c428a24122fae12185ff9f46bd9ffb7..0e009528b4dcd1aa14f70a22f611cdd684ee3088 100644 |
--- a/src/sfnt/SkOTUtils.cpp |
+++ b/src/sfnt/SkOTUtils.cpp |
@@ -83,8 +83,8 @@ SkData* SkOTUtils::RenameFont(SkStream* fontData, const char* fontName, int font |
size_t originalDataSize = fontData->getLength() - oldNameTablePhysicalSize; |
size_t newDataSize = originalDataSize + nameTablePhysicalSize; |
- SK_OT_BYTE* data = static_cast<SK_OT_BYTE*>(sk_malloc_throw(newDataSize)); |
- SkAutoTUnref<SkData> rewrittenFontData(SkData::NewFromMalloc(data, newDataSize)); |
+ SkAutoTUnref<SkData> rewrittenFontData(SkData::NewUninitialized(newDataSize)); |
+ SK_OT_BYTE* data = static_cast<SK_OT_BYTE*>(rewrittenFontData->writable_data()); |
if (fontData->read(data, oldNameTableOffset) < oldNameTableOffset) { |
return NULL; |