Index: src/codec/SkCodec.cpp |
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp |
index 50c172927ee02762f3aaa2a96aceb232966dfdd0..f5a6d36e3b981a31efba661ba05447f4611c575e 100644 |
--- a/src/codec/SkCodec.cpp |
+++ b/src/codec/SkCodec.cpp |
@@ -166,6 +166,15 @@ |
ctable = nullptr; |
} |
+ { |
+ SkAlphaType canonical; |
+ if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &canonical) |
+ || canonical != info.alphaType()) |
+ { |
+ return kInvalidConversion; |
+ } |
+ } |
+ |
if (!this->rewindIfNeeded()) { |
return kCouldNotRewind; |
} |