From 78663f9dad1235e47c2fa9cfd1a9dd979d373871 Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Fri, 23 Feb 2018 14:45:36 -0500 Subject: Fix overflow in number of bytes to erase. The width and the height were multiplied as int * int. Now it is int64_t * int64_t. BUG=chromium:812519 Change-Id: If60bbdd8ee92748559b2e4f3ab57e4463a8006e8 Reviewed-on: https://skia-review.googlesource.com/109781 Reviewed-by: Florin Malita Commit-Queue: Herb Derby --- src/core/SkPixmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp index 8a0acb913a..19d1d65caa 100644 --- a/src/core/SkPixmap.cpp +++ b/src/core/SkPixmap.cpp @@ -123,7 +123,7 @@ bool SkPixmap::erase(SkColor color, const SkIRect& inArea) const { && width == this->rowBytesAsPixels() && inArea == this->bounds()) { // All formats represent SkColor(0) as byte 0. - memset(this->writable_addr(), 0, height * rowBytes); + memset(this->writable_addr(), 0, (int64_t)height * rowBytes); return true; } -- cgit v1.2.3