Index: src/codec/SkBmpCodec.cpp |
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp |
index 191c2ad8009cbc39e713a2a56452e632a7e84012..2e9eca9fe49714fe665af6f6d8c96a18d3d07823 100644 |
--- a/src/codec/SkBmpCodec.cpp |
+++ b/src/codec/SkBmpCodec.cpp |
@@ -554,7 +554,7 @@ int32_t SkBmpCodec::getDstRow(int32_t y, int32_t height) const { |
uint32_t SkBmpCodec::computeNumColors(uint32_t numColors) { |
// Zero is a default for maxColors |
// Also set numColors to maxColors when it is too large |
- uint32_t maxColors = 1 << fBitsPerPixel; |
+ uint32_t maxColors = fBitsPerPixel >= 32 ? UINT32_MAX : 1 << fBitsPerPixel; |
msarett
2015/12/03 20:55:22
Can we use 0 instead of UINT32_MAX? While you're
|
if (numColors == 0 || numColors >= maxColors) { |
return maxColors; |
} |