diff options
author | Robin Gareus <robin@gareus.org> | 2019-08-20 04:11:32 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-08-20 04:11:32 +0200 |
commit | bb27d10fd4c0c64b1ef1778ba647b641efade523 (patch) | |
tree | 17dbcb986f41123931ff50cb8ee965d8709e2233 /libs/ardour/chan_count.cc | |
parent | a1b0991d26504629f49f33f943702feb05bb7672 (diff) |
Fix potential ambiguous state-restore
Don't allow uninitialized argument values in case of corrupt XML
state.
Diffstat (limited to 'libs/ardour/chan_count.cc')
-rw-r--r-- | libs/ardour/chan_count.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/ardour/chan_count.cc b/libs/ardour/chan_count.cc index e14949f360..6324f8c0fb 100644 --- a/libs/ardour/chan_count.cc +++ b/libs/ardour/chan_count.cc @@ -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); + } } } } |