Index: src/lazy/SkDiscardablePixelRef.cpp |
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp |
index b810c2b1839b9bc4d0cf031edbf9b470e60c844a..1e42042fb6d10c05626f8a3d5bedd28dfcb257c8 100644 |
--- a/src/lazy/SkDiscardablePixelRef.cpp |
+++ b/src/lazy/SkDiscardablePixelRef.cpp |
@@ -109,12 +109,12 @@ void SkDiscardablePixelRef::onUnlockPixels() { |
bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst, |
SkDiscardableMemory::Factory* factory) { |
- SkImageInfo info; |
SkAutoTDelete<SkImageGenerator> autoGenerator(generator); |
- if ((NULL == autoGenerator.get()) |
- || (!autoGenerator->getInfo(&info)) |
- || info.isEmpty() |
- || (!dst->setInfo(info))) { |
+ if (NULL == autoGenerator.get()) { |
+ return false; |
+ } |
+ SkImageInfo info = autoGenerator->getInfo(); |
+ if (info.isEmpty() || !dst->setInfo(info)) { |
return false; |
} |
// Since dst->setInfo() may have changed/fixed-up info, we copy it back from that bitmap |