init matrix if buffer is already bad

Bug: skia:
Change-Id: I8d21d846a0657a1e9530adc6613d398932b69e5f
Reviewed-on: https://skia-review.googlesource.com/104660
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Mike Reed 2018-02-06 16:58:21 -05:00 committed by Skia Commit-Bot
parent ed858ec095
commit 2a223358ed

View File

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