Index: src/core/SkBitmap.cpp |
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp |
index 8cb8e4d6fc9f530c290c8fc86477572a6406e592..863169c458b8d76642d3aae13e923c68cb90ede3 100644 |
--- a/src/core/SkBitmap.cpp |
+++ b/src/core/SkBitmap.cpp |
@@ -1145,8 +1145,10 @@ bool SkBitmap::ReadRawPixels(SkReadBuffer* buffer, SkBitmap* bitmap) { |
SkImageInfo info; |
info.unflatten(*buffer); |
- // If there was an error reading "info", don't use it to compute minRowBytes() |
- if (!buffer->validate(true)) { |
+ // If there was an error reading "info" or if it is bogus, |
+ // don't use it to compute minRowBytes() |
+ if (!buffer->validate(SkColorTypeValidateAlphaType(info.colorType(), |
+ info.alphaType()))) { |
return false; |
} |