Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 9cf84493ad89b4c555539fc0b24825a212b24a5d..b0fa7f7053d36d7050dbbd3fd407fa1329bead06 100644 |
--- a/src/images/SkImageDecoder_libwebp.cpp |
+++ b/src/images/SkImageDecoder_libwebp.cpp |
@@ -412,25 +412,16 @@ bool SkWEBPImageDecoder::onDecode(SkStream* stream, SkBitmap* decodedBitmap, |
const int sampleSize = this->getSampleSize(); |
SkScaledBitmapSampler sampler(origWidth, origHeight, sampleSize); |
+ if (!setDecodeConfig(decodedBitmap, sampler.scaledWidth(), |
+ sampler.scaledHeight())) { |
+ return false; |
+ } |
// If only bounds are requested, done |
if (SkImageDecoder::kDecodeBounds_Mode == mode) { |
- if (!setDecodeConfig(decodedBitmap, sampler.scaledWidth(), |
- sampler.scaledHeight())) { |
- return false; |
- } |
return true; |
} |
- // No Bitmap reuse supported for this format |
- if (!decodedBitmap->isNull()) { |
- return false; |
- } |
- if (!setDecodeConfig(decodedBitmap, sampler.scaledWidth(), |
- sampler.scaledHeight())) { |
- return false; |
- } |
- |
if (!this->allocPixelRef(decodedBitmap, NULL)) { |
return return_false(*decodedBitmap, "allocPixelRef"); |
} |