diff options
author | Robert Phillips <robertphillips@google.com> | 2017-05-25 15:36:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-26 18:24:43 +0000 |
commit | 10240e385f541f9a6dea30469bda84c92799fbd9 (patch) | |
tree | bd7d271e551d338398d5f8604a595655e4bf364e | |
parent | ae0c50c62432ba9683bf2deec567bdabb2b9f825 (diff) |
Initialize rects in SkValidatingReadBuffer readRect & readIRect on failure
BUG: 726199
Change-Id: I2afeebbd2240e1c2f3b7d7298cb11572eef18acd
Reviewed-on: https://skia-review.googlesource.com/17984
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Reed <reed@google.com>
-rw-r--r-- | src/core/SkValidatingReadBuffer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp index 01929682d2..253b3f21f3 100644 --- a/src/core/SkValidatingReadBuffer.cpp +++ b/src/core/SkValidatingReadBuffer.cpp @@ -145,6 +145,8 @@ void SkValidatingReadBuffer::readIRect(SkIRect* rect) { const void* ptr = this->skip(sizeof(SkIRect)); if (!fError) { memcpy(rect, ptr, sizeof(SkIRect)); + } else { + rect->setEmpty(); } } @@ -152,6 +154,8 @@ void SkValidatingReadBuffer::readRect(SkRect* rect) { const void* ptr = this->skip(sizeof(SkRect)); if (!fError) { memcpy(rect, ptr, sizeof(SkRect)); + } else { + rect->setEmpty(); } } |