Index: src/codec/SkCodec_wbmp.cpp |
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp |
index 86dce5cc89e95590f8d0d138df9bda352994f95d..69ef7d4091d0aa3f6f3c514185c0cc2ca70277e8 100644 |
--- a/src/codec/SkCodec_wbmp.cpp |
+++ b/src/codec/SkCodec_wbmp.cpp |
@@ -128,6 +128,10 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info, |
return kInvalidScale; |
} |
+ if (!valid_alpha(info.alphaType(), this->getInfo().alphaType())) { |
+ return SkCodec::kInvalidConversion; |
+ } |
+ |
// Prepare a color table if necessary |
setup_color_table(info.colorType(), ctable, ctableCount); |
@@ -208,6 +212,10 @@ public: |
return SkCodec::kInvalidScale; |
} |
+ if (!valid_alpha(dstInfo.alphaType(), this->getInfo().alphaType())) { |
+ return SkCodec::kInvalidConversion; |
+ } |
+ |
// Fill in the color table |
setup_color_table(dstInfo.colorType(), inputColorTable, inputColorCount); |