Index: dm/DMWriteTask.cpp |
diff --git a/dm/DMWriteTask.cpp b/dm/DMWriteTask.cpp |
index 890a4bb052b719e096fd51bd15eb2212a22ce6b6..f7fa014ea45880a78ab9dd66d43b80ccc8750a4b 100644 |
--- a/dm/DMWriteTask.cpp |
+++ b/dm/DMWriteTask.cpp |
@@ -84,8 +84,11 @@ struct PngAndRaw { |
} |
const size_t offset = data->size() - bitmapBytes; |
+ SkAutoTUnref<SkData> subset( |
+ SkData::NewSubset(data, offset, bitmapBytes)); |
SkAutoTUnref<SkPixelRef> pixels( |
- SkMallocPixelRef::NewWithData(info, rowBytes, NULL/*ctable*/, data, offset)); |
+ SkMallocPixelRef::NewWithData( |
+ info, rowBytes, NULL/*ctable*/, subset)); |
SkASSERT(pixels); |
bitmap->setConfig(info, rowBytes); |