From 334781463a8d9221a7b7adf1137bedc9d7c8d4cb Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 31 May 2017 09:59:34 -0400 Subject: [PATCH] [M60 cherry pick] Initialize rects in SkValidatingReadBuffer readRect & readIRect on failure TBR=reed@google.com No-Tree-Checks: true No-Try: true No-Presubmit: true Bug: 726199 Change-Id: Ibaf5391d01565a522d3230cd6ac066cc522ad739 Reviewed-on: https://skia-review.googlesource.com/18226 Reviewed-by: Robert Phillips --- src/core/SkValidatingReadBuffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp index 0192968..253b3f2 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(); } } -- 2.7.4