From 75bfa4946bda29331935bb7fca12d43e3a5f749b Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 31 Aug 2010 23:06:24 +0000 Subject: [PATCH] Fixed crash in case that an invalid .music file is in a track directory. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5837 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/audio/music_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/audio/music_manager.cpp b/src/audio/music_manager.cpp index 8c1e02975..6149abed7 100644 --- a/src/audio/music_manager.cpp +++ b/src/audio/music_manager.cpp @@ -111,7 +111,14 @@ void MusicManager::loadMusicFromOneDir(const std::string& dir) for(std::set::iterator i = files.begin(); i != files.end(); ++i) { if(StringUtils::getExtension(*i)!="music") continue; - m_allMusic[StringUtils::getBasename(*i)] = new MusicInformation(*i); + try + { + m_allMusic[StringUtils::getBasename(*i)] = new MusicInformation(*i); + } + catch (std::exception& e) + { + continue; + } } // for i } // loadMusicFromOneDir