diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp index d82ec4a046..73e7af0fd7 100644 --- a/src/core/SkReadBuffer.cpp +++ b/src/core/SkReadBuffer.cpp @@ -182,9 +182,10 @@ void SkReadBuffer::readMatrix(SkMatrix* matrix) { size_t size = 0; if (this->isValid()) { size = SkMatrixPriv::ReadFromMemory(matrix, fReader.peek(), fReader.available()); - if (!this->validate((SkAlign4(size) == size) && (0 != size))) { - matrix->reset(); - } + (void)this->validate((SkAlign4(size) == size) && (0 != size)); + } + if (!this->isValid()) { + matrix->reset(); } (void)this->skip(size); }