Index: tools/skhello.cpp |
diff --git a/tools/skhello.cpp b/tools/skhello.cpp |
index 3b8ddee9a6202c5c1a06c19387f2df9fc97bb468..668c3a993d901cf1899cb0adfabc1d8e8dd21c8f 100644 |
--- a/tools/skhello.cpp |
+++ b/tools/skhello.cpp |
@@ -57,6 +57,9 @@ int tool_main(int argc, char** argv) { |
SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); |
SkAutoDataUnref data(image->encode()); |
+ if (NULL == data.get()) { |
+ return -1; |
+ } |
SkFILEWStream stream(path.c_str()); |
return stream.write(data->data(), data->size()); |
} |