aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPixmap.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-02-23 14:45:36 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-26 17:53:48 +0000
commit78663f9dad1235e47c2fa9cfd1a9dd979d373871 (patch)
tree9bf9b1056cb41bc649554b5ac9fef35efc1d3f0c /src/core/SkPixmap.cpp
parent352ad2cbf1f4ab6b3341d958d958bfef16d7242d (diff)
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 <fmalita@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkPixmap.cpp')
-rw-r--r--src/core/SkPixmap.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}