use SkData::NewUninitialized
BUG=skia:
R=bungeman@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/565803005
diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp
index 359eb37..3b5cb78 100644
--- a/src/images/SkDecodingImageGenerator.cpp
+++ b/src/images/SkDecodingImageGenerator.cpp
@@ -139,13 +139,11 @@
return NULL;
}
size_t length = fStream->getLength();
- if (0 == length) {
- return NULL;
+ if (length) {
+ fData = SkData::NewFromStream(fStream, length);
}
- fData = SkData::NewUninitialized(length);
- SkCheckResult(fStream->read(fData->writable_data(), length), length);
}
- return SkRef(fData);
+ return SkSafeRef(fData);
}
bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info,