make information extraction from session file options list robust against some old badly formatted session files
Fixes crash experienced by GillesM, where a rogue XML entry caused a segfault
This commit is contained in:
parent
f5cd838afc
commit
e43a8dac1c
@ -3784,7 +3784,15 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo
|
||||
const XMLNodeList& options (child->children());
|
||||
for (XMLNodeList::const_iterator oc = options.begin(); oc != options.end(); ++oc) {
|
||||
const XMLNode* option = *oc;
|
||||
if (option->property("name")->value() == "native-file-data-format") {
|
||||
const XMLProperty* name = option->property("name");
|
||||
|
||||
if (!name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name->value() == "native-file-data-format") {
|
||||
const XMLProperty* value = option->property ("value");
|
||||
if (value) {
|
||||
SampleFormat fmt = (SampleFormat) string_2_enum (option->property ("value")->value(), fmt);
|
||||
data_format = fmt;
|
||||
found_data_format = true;
|
||||
@ -3792,6 +3800,7 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found_data_format) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user