Index: src/core/SkBitmap.cpp |
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp |
index e28c6fdc3488ff486d98a338828389d5d2e4f131..f0ad029bea9285b74f03bbb0700ad09d1255c797 100644 |
--- a/src/core/SkBitmap.cpp |
+++ b/src/core/SkBitmap.cpp |
@@ -1211,9 +1211,9 @@ bool SkBitmap::ReadRawPixels(SkReadBuffer* buffer, SkBitmap* bitmap) { |
return false; |
} |
- char* dst = (char*)sk_malloc_throw(ramSize); |
+ SkAutoDataUnref data(SkData::NewUninitialized(ramSize)); |
+ char* dst = (char*)data->writable_data(); |
buffer->readByteArray(dst, snugSize); |
- SkAutoDataUnref data(SkData::NewFromMalloc(dst, ramSize)); |
if (snugSize != ramSize) { |
const char* srcRow = dst + snugRB * (height - 1); |