Index: src/core/SkValidatingReadBuffer.cpp |
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp |
index 037a99465b2853f34627b379ba32323277a3f3ea..8202149cc1d2ed3f384f112ba32d7c9f2e30a018 100644 |
--- a/src/core/SkValidatingReadBuffer.cpp |
+++ b/src/core/SkValidatingReadBuffer.cpp |
@@ -171,6 +171,17 @@ void SkValidatingReadBuffer::readPath(SkPath* path) { |
} |
} |
+void SkValidatingReadBuffer::readPatch(SkPatch* patch) { |
+ size_t size = 0; |
+ if (!fError) { |
+ size = patch->readFromMemory(fReader.peek(), fReader.available()); |
+ this->validate((SkAlign4(size) == size) && (0 != size)); |
+ } |
+ if (!fError) { |
+ (void)this->skip(size); |
+ } |
+} |
+ |
bool SkValidatingReadBuffer::readArray(void* value, size_t size, size_t elementSize) { |
const uint32_t count = this->getArrayCount(); |
this->validate(size == count); |