diff options
-rw-r--r-- | chromium/third_party/skia/src/core/SkMask.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chromium/third_party/skia/src/core/SkMask.cpp b/chromium/third_party/skia/src/core/SkMask.cpp index 167d30d166b..7340d70f1ae 100644 --- a/chromium/third_party/skia/src/core/SkMask.cpp +++ b/chromium/third_party/skia/src/core/SkMask.cpp @@ -45,7 +45,14 @@ uint8_t* SkMask::AllocImage(size_t size) { #ifdef TRACK_SKMASK_LIFETIME SkDebugf("SkMask::AllocImage %d\n", gCounter++); #endif - return (uint8_t*)sk_malloc_throw(SkAlign4(size)); + size_t aligned_size = std::numeric_limits<size_t>::max(); + + // Expand size to next multiple of four. + size_t adjustment = 3; + if (size + adjustment > size) { + aligned_size = (size + adjustment) & ~adjustment; + } + return static_cast<uint8_t*>(sk_malloc_throw(aligned_size)); } /** We explicitly use this allocator for SkBimap pixels, so that we can |