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>
This commit is contained in:
Robert Phillips 2017-05-25 15:36:20 -04:00 committed by Skia Commit-Bot
parent ae0c50c624
commit 10240e385f

View File

@ -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();
}
}