| Index: src/core/SkColorTable.cpp
|
| diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp
|
| index 242ea6ba64a5c37e1440da31c7fff6a51a3ca42c..53c599ff3fc67b98e0fe14e768763fedc61b825b 100644
|
| --- a/src/core/SkColorTable.cpp
|
| +++ b/src/core/SkColorTable.cpp
|
| @@ -92,8 +92,9 @@ SkColorTable::SkColorTable(SkFlattenableReadBuffer& buffer) {
|
|
|
| fAlphaType = SkToU8(buffer.readUInt());
|
| fCount = buffer.getArrayCount();
|
| - fColors = (SkPMColor*)sk_malloc_throw(fCount * sizeof(SkPMColor));
|
| - SkDEBUGCODE(const uint32_t countRead =) buffer.readColorArray(fColors);
|
| + uint32_t size = fCount * sizeof(SkPMColor);
|
| + fColors = (SkPMColor*)sk_malloc_throw(size);
|
| + SkDEBUGCODE(const uint32_t countRead =) buffer.readColorArray(fColors, size);
|
| #ifdef SK_DEBUG
|
| SkASSERT((unsigned)fCount <= 256);
|
| SkASSERT(countRead == fCount);
|
|
|