Fix potential ambiguous state-restore
Don't allow uninitialized argument values in case of corrupt XML state.
This commit is contained in:
parent
a1b0991d26
commit
bb27d10fd4
|
@ -38,11 +38,11 @@ ChanCount::ChanCount(const XMLNode& node)
|
|||
XMLNodeConstIterator iter = node.children().begin();
|
||||
for ( ; iter != node.children().end(); ++iter) {
|
||||
if ((*iter)->name() == X_(state_node_name)) {
|
||||
DataType type(DataType::NIL);
|
||||
DataType type (DataType::NIL);
|
||||
uint32_t count;
|
||||
(*iter)->get_property("type", type);
|
||||
(*iter)->get_property("count", count);
|
||||
set(type, count);
|
||||
if ((*iter)->get_property ("type", type) && (*iter)->get_property ("count", count)) {
|
||||
set(type, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,13 +55,14 @@ ChanMapping::ChanMapping (const XMLNode& node)
|
|||
XMLNodeConstIterator iter = node.children().begin();
|
||||
for ( ; iter != node.children().end(); ++iter) {
|
||||
if ((*iter)->name() == X_(state_node_name)) {
|
||||
DataType type(DataType::NIL);
|
||||
DataType type (DataType::NIL);
|
||||
uint32_t from;
|
||||
uint32_t to;
|
||||
(*iter)->get_property("type", type);
|
||||
(*iter)->get_property("from", from);
|
||||
(*iter)->get_property("to", to);
|
||||
set(type, from, to);
|
||||
if ( (*iter)->get_property ("type", type)
|
||||
&& (*iter)->get_property ("from", from)
|
||||
&& (*iter)->get_property ("to", to)) {
|
||||
set(type, from, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user