Index: src/images/SkImageDecoder_libbmp.cpp |
diff --git a/src/images/SkImageDecoder_libbmp.cpp b/src/images/SkImageDecoder_libbmp.cpp |
index 3aa834a6b567182e30646d89519b12f14133c21e..ac163521fe4c17d046377d8b1b3a87988278d412 100644 |
--- a/src/images/SkImageDecoder_libbmp.cpp |
+++ b/src/images/SkImageDecoder_libbmp.cpp |
@@ -115,11 +115,18 @@ bool SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
SkScaledBitmapSampler sampler(width, height, getSampleSize()); |
- bm->setConfig(config, sampler.scaledWidth(), sampler.scaledHeight()); |
- bm->setIsOpaque(true); |
if (justBounds) { |
+ bm->setConfig(config, sampler.scaledWidth(), sampler.scaledHeight()); |
+ bm->setIsOpaque(true); |
return true; |
} |
+ // No Bitmap reuse supported for this format |
+ if (!bm->isNull()) { |
+ return false; |
+ } |
+ |
+ bm->setConfig(config, sampler.scaledWidth(), sampler.scaledHeight()); |
+ bm->setIsOpaque(true); |
if (!this->allocPixelRef(bm, NULL)) { |
return false; |