diff options
author | 2015-08-28 12:38:04 -0700 | |
---|---|---|
committer | 2015-08-28 12:38:04 -0700 | |
commit | 264873d5a8b5b7777684e999aead1da75822e079 (patch) | |
tree | 1ca21761acf027f31f3b02da6cfb3a700fe8d5e8 | |
parent | 5b4c69e555f60cb2355a62a6d056a9a59d7f21bf (diff) |
fix bounds check for ctables (thanks Hal)
BUG=skia:
Review URL: https://codereview.chromium.org/1319973008
-rw-r--r-- | src/core/SkColorTable.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp index e461a095f0..ca9a8657c4 100644 --- a/src/core/SkColorTable.cpp +++ b/src/core/SkColorTable.cpp @@ -36,7 +36,7 @@ SkColorTable::SkColorTable(SkPMColor* colors, int count, AllocatedWithMalloc) : fColors(colors) , fCount(count) { - SkASSERT(count > 0 && count <= 255); + SkASSERT(count > 0 && count <= 256); SkASSERT(colors); } @@ -108,7 +108,7 @@ SkColorTable* SkColorTable::Create(SkReadBuffer& buffer) { return new SkColorTable(nullptr, 0); } - if (count < 0 || count > 255) { + if (count < 0 || count > 256) { buffer.validate(false); return nullptr; } |