fix bounds check for ctables (thanks Hal)
BUG=skia: Review URL: https://codereview.chromium.org/1319973008
This commit is contained in:
parent
5b4c69e555
commit
264873d5a8
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user