Index: src/pdf/SkPDFFont.cpp |
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp |
index 652b56d706683d26a7f848e5ffafbc2b851ddd41..9e13053c60db85de10d61ed01637c8a89fb08473 100644 |
--- a/src/pdf/SkPDFFont.cpp |
+++ b/src/pdf/SkPDFFont.cpp |
@@ -1312,13 +1312,13 @@ bool SkPDFType1Font::addFontDescriptor(int16_t defaultWidth) { |
size_t data SK_INIT_TO_AVOID_WARNING; |
size_t trailer SK_INIT_TO_AVOID_WARNING; |
SkAutoTUnref<SkStream> rawFontData(typeface()->openStream(&ttcIndex)); |
- SkData* fontData = handle_type1_stream(rawFontData.get(), &header, &data, |
- &trailer); |
- if (fontData == NULL) { |
+ SkAutoTUnref<SkData> fontData(handle_type1_stream(rawFontData.get(), &header, |
+ &data, &trailer)); |
+ if (fontData.get() == NULL) { |
return false; |
} |
if (canEmbed()) { |
- SkAutoTUnref<SkPDFStream> fontStream(new SkPDFStream(fontData)); |
+ SkAutoTUnref<SkPDFStream> fontStream(new SkPDFStream(fontData.get())); |
addResource(fontStream.get()); |
fontStream->insertInt("Length1", header); |
fontStream->insertInt("Length2", data); |