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_mapping.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_mapping.cc')
-rw-r--r-- | libs/ardour/chan_mapping.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/chan_mapping.cc b/libs/ardour/chan_mapping.cc index c4e933ad05..3ccc92d42a 100644 --- a/libs/ardour/chan_mapping.cc +++ b/libs/ardour/chan_mapping.cc @@ -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); + } } } } |