diff options
author | Carl Hetherington <carl@carlh.net> | 2012-04-11 10:51:21 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-04-11 10:51:21 +0000 |
commit | 0860570c8cccb50229e5321477a72bce915f7235 (patch) | |
tree | 6f3a755d291bd3c6d06f93531d8faa1330005b14 /libs/ardour | |
parent | 86a86f482ffb715d4a594f93cf9ea4a2a312a20e (diff) |
Fix a few unchecked XML child / property lookups
(#4814).
git-svn-id: svn://localhost/ardour2/branches/3.0@11894 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/audio_playlist_importer.cc | 8 | ||||
-rw-r--r-- | libs/ardour/audio_track_importer.cc | 17 |
2 files changed, 23 insertions, 2 deletions
diff --git a/libs/ardour/audio_playlist_importer.cc b/libs/ardour/audio_playlist_importer.cc index 681f563e68..1c119e0ed7 100644 --- a/libs/ardour/audio_playlist_importer.cc +++ b/libs/ardour/audio_playlist_importer.cc @@ -178,7 +178,13 @@ AudioPlaylistImporter::_prepare_move () } name = rename_pair.second; } - xml_playlist.property ("name")->set_value (name); + + XMLProperty* p = xml_playlist.property ("name"); + if (!p) { + error << _("badly-formed XML in imported playlist") << endmsg; + } + + p->set_value (name); handler.add_name (name); return true; diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc index 88dcf77958..b3ac93e010 100644 --- a/libs/ardour/audio_track_importer.cc +++ b/libs/ardour/audio_track_importer.cc @@ -223,6 +223,7 @@ AudioTrackImporter::get_info () const return name; } +/** @return true if everything is ok */ bool AudioTrackImporter::_prepare_move () { @@ -247,7 +248,21 @@ AudioTrackImporter::_prepare_move () } name = rename_pair.second; } - xml_track.child ("IO")->property ("name")->set_value (name); + + XMLNode* c = xml_track.child ("IO"); + if (!c) { + error << _("badly-formed XML in imported track") << endmsg; + return false; + } + + XMLProperty* p = c->property ("name"); + if (!p) { + error << _("badly-formed XML in imported track") << endmsg; + return false; + } + + p->set_value (name); + track_handler.add_name (name); return true; |