Index: src/core/SkValidatingReadBuffer.cpp |
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp |
index ad4b6c409e6a0adca7c85b87c69a59089ac76779..c80192f8b26d965a24b1f61bfa7abe2cbd8946e1 100644 |
--- a/src/core/SkValidatingReadBuffer.cpp |
+++ b/src/core/SkValidatingReadBuffer.cpp |
@@ -222,20 +222,14 @@ bool SkValidatingReadBuffer::validateAvailable(size_t size) { |
return this->validate((size <= SK_MaxU32) && fReader.isAvailable(static_cast<uint32_t>(size))); |
} |
-SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type type) { |
+SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type) { |
SkString name; |
this->readString(&name); |
if (fError) { |
return nullptr; |
} |
- // Is this the type we wanted ? |
const char* cname = name.c_str(); |
- SkFlattenable::Type baseType; |
- if (!SkFlattenable::NameToType(cname, &baseType) || (baseType != type)) { |
Stephen White
2016/04/05 18:10:51
I believe this code is necessary for security. sug
|
- return nullptr; |
- } |
- |
SkFlattenable::Factory factory = SkFlattenable::NameToFactory(cname); |
if (nullptr == factory) { |
return nullptr; // writer failed to give us the flattenable |