Index: src/core/SkValidatingReadBuffer.cpp |
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp |
index bc5611a3e382902878ca99256f6d26ff0e80c3c2..a45c6ca9b0623f483e802667401c307f3387b8f9 100644 |
--- a/src/core/SkValidatingReadBuffer.cpp |
+++ b/src/core/SkValidatingReadBuffer.cpp |
@@ -246,6 +246,12 @@ SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type type) |
SkFlattenable* obj = nullptr; |
uint32_t sizeRecorded = this->readUInt(); |
if (factory) { |
+ // Check if a custom Factory has been specified for this flattenable. |
+ SkFlattenable::Factory* customFactoryPtr = getCustomFactory(factory); |
+ if (customFactoryPtr) { |
+ factory = *customFactoryPtr; |
+ } |
+ |
size_t offset = fReader.offset(); |
obj = (*factory)(*this); |
// check that we read the amount we expected |