Index: src/codec/SkCodec.cpp |
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp |
index 3e5ebe185091488cc45ec5bea0c65d70ca7e0578..62eec2744c0f2b47318761334c5e0ffecb28ecd3 100644 |
--- a/src/codec/SkCodec.cpp |
+++ b/src/codec/SkCodec.cpp |
@@ -123,6 +123,15 @@ SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t |
ctable = NULL; |
} |
+ { |
+ SkAlphaType canonical; |
+ if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &canonical) |
+ || canonical != info.alphaType()) |
+ { |
+ return kInvalidConversion; |
+ } |
+ } |
+ |
// Default options. |
Options optsStorage; |
if (NULL == options) { |