Index: src/images/SkDecodingImageGenerator.cpp |
diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp |
index 88cdef9a321f8a8875589aa7461e5a40611df57a..dfa093becc5d5ff7162727729d04e175fe1d18f0 100644 |
--- a/src/images/SkDecodingImageGenerator.cpp |
+++ b/src/images/SkDecodingImageGenerator.cpp |
@@ -246,6 +246,11 @@ SkImageGenerator* CreateDecodingImageGenerator( |
if (opts.fRequireUnpremul && info.fAlphaType != kOpaque_SkAlphaType) { |
info.fAlphaType = kUnpremul_SkAlphaType; |
} |
+ |
+ if (!SkColorTypeValidateAlphaType(info.fColorType, info.fAlphaType, &info.fAlphaType)) { |
+ return NULL; |
+ } |
+ |
return SkNEW_ARGS(DecodingImageGenerator, |
(data, autoStream.detach(), info, |
opts.fSampleSize, opts.fDitherImage)); |