Index: tests/SerializationTest.cpp |
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp |
index 2ddd368433ba2e17fc0b02fbd78d3eb0cf3fc9ce..dfc7afa4fc4ef3c4365129dc4414edbf89c3e18a 100644 |
--- a/tests/SerializationTest.cpp |
+++ b/tests/SerializationTest.cpp |
@@ -9,6 +9,7 @@ |
#include "SkBitmapSource.h" |
#include "SkCanvas.h" |
#include "SkMallocPixelRef.h" |
+#include "SkTemplates.h" |
#include "SkWriteBuffer.h" |
#include "SkValidatingReadBuffer.h" |
#include "SkXfermodeImageFilter.h" |
@@ -378,11 +379,11 @@ DEF_TEST(Serialization, reporter) { |
SkWriteBuffer writer(SkWriteBuffer::kValidation_Flag); |
pict->flatten(writer); |
size_t size = writer.bytesWritten(); |
- void* data = sk_malloc_throw(size); |
- writer.writeToMemory(data); |
+ SkAutoTMalloc<unsigned char> data(size); |
+ writer.writeToMemory(static_cast<void*>(data.get())); |
// Deserialize picture |
- SkValidatingReadBuffer reader(data, size); |
+ SkValidatingReadBuffer reader(static_cast<void*>(data.get()), size); |
SkAutoTUnref<SkPicture> readPict( |
SkPicture::CreateFromBuffer(reader)); |
REPORTER_ASSERT(reporter, NULL != readPict.get()); |