Index: src/images/SkImageEncoder.cpp |
diff --git a/src/images/SkImageEncoder.cpp b/src/images/SkImageEncoder.cpp |
index 22bbc57c2f593a083734311f0c2dadb5f4994947..023885f4591859f82f7ea0e1bbd447b449a7ea64 100644 |
--- a/src/images/SkImageEncoder.cpp |
+++ b/src/images/SkImageEncoder.cpp |
@@ -31,7 +31,7 @@ SkData* SkImageEncoder::encodeData(const SkBitmap& bm, int quality) { |
SkDynamicMemoryWStream stream; |
quality = SkMin32(100, SkMax32(0, quality)); |
if (this->onEncode(&stream, bm, quality)) { |
- return stream.copyToData(); |
+ return stream.detachAsData().release(); |
} |
return nullptr; |
} |