aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkValidatingReadBuffer.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-09-23 14:23:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-09-23 19:44:57 +0000
commit49da334086c4a2c0bc4cb99e97965600dcb72f73 (patch)
treee901a94815caa32d4e70f40f25621681cbb6f174 /src/core/SkValidatingReadBuffer.cpp
parentaa840647fc7f057715bce62489b96c4299385135 (diff)
Add validation of RRects to SkValidatingReadBuffer
This comes from the Skia fuzzer where it is inverting the RRect's rect which causes trouble down the line. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2591 Change-Id: I5c34105a47369492d2df99d39a4e29116060ad37 Reviewed-on: https://skia-review.googlesource.com/2591 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkValidatingReadBuffer.cpp')
-rw-r--r--src/core/SkValidatingReadBuffer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp
index 326d0cf575..1566af9488 100644
--- a/src/core/SkValidatingReadBuffer.cpp
+++ b/src/core/SkValidatingReadBuffer.cpp
@@ -144,6 +144,11 @@ void SkValidatingReadBuffer::readRRect(SkRRect* rrect) {
const void* ptr = this->skip(sizeof(SkRRect));
if (!fError) {
memcpy(rrect, ptr, sizeof(SkRRect));
+ this->validate(rrect->isValid());
+ }
+
+ if (fError) {
+ rrect->setEmpty();
}
}