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>
(cherry picked from commit 78663f9dad1235e47c2fa9cfd1a9dd979d373871)
Reviewed-on: https://skia-review.googlesource.com/113780
Reviewed-by: Hal Canary <halcanary@google.com>
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp
index 7873a9b..ca86c7b 100644
--- a/src/core/SkPixmap.cpp
+++ b/src/core/SkPixmap.cpp
@@ -121,7 +121,7 @@
&& 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;
}