mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Tweaked handling of corrupted data in ValueTree::readFromStream
This commit is contained in:
parent
1c382e83fc
commit
7037b7243e
1 changed files with 10 additions and 3 deletions
|
|
@ -1003,10 +1003,17 @@ ValueTree ValueTree::readFromStream (InputStream& input)
|
|||
for (int i = 0; i < numProps; ++i)
|
||||
{
|
||||
const String name (input.readString());
|
||||
jassert (name.isNotEmpty());
|
||||
|
||||
if (name.isNotEmpty())
|
||||
{
|
||||
const var value (var::readFromStream (input));
|
||||
v.object->properties.set (name, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse; // trying to read corrupted data!
|
||||
}
|
||||
}
|
||||
|
||||
const int numChildren = input.readCompressedInt();
|
||||
v.object->children.ensureStorageAllocated (numChildren);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue