Index: src/utils/SkBitSet.h |
diff --git a/src/utils/SkBitSet.h b/src/utils/SkBitSet.h |
index a8585a20b9ea9d30820ca9ad7b3c64d1d5f52bdd..2e2dbebbb277879534692ea5117b30bd451e725e 100644 |
--- a/src/utils/SkBitSet.h |
+++ b/src/utils/SkBitSet.h |
@@ -14,9 +14,11 @@ |
class SkBitSet { |
public: |
explicit SkBitSet(int numberOfBits) { |
- SkASSERT(numberOfBits > 0); |
+ SkASSERT(numberOfBits >= 0); |
fDwordCount = (numberOfBits + 31) / 32; // Round up size to 32-bit boundary. |
- fBitData.reset((uint32_t*)sk_calloc_throw(fDwordCount * sizeof(uint32_t))); |
+ if (fDwordCount > 0) { |
+ fBitData.reset((uint32_t*)sk_calloc_throw(fDwordCount * sizeof(uint32_t))); |
+ } |
} |
SkBitSet(const SkBitSet&) = delete; |