- coverity based bug fixes - round #1

This commit is contained in:
SoftCoder
2013-12-13 23:04:12 -08:00
parent c887b0c357
commit b9d6b38e8f
53 changed files with 651 additions and 416 deletions

View File

@@ -81,16 +81,16 @@ void StaticSound::load(const string &path) {
string ext= path.substr(path.find_last_of('.')+1);
soundFileLoader= SoundFileLoaderFactory::getInstance()->newInstance(ext);
if(soundFileLoader == NULL) {
throw megaglest_runtime_error("soundFileLoader == NULL");
}
soundFileLoader->open(path, &info);
samples= new int8[info.getSize()];
soundFileLoader->read(samples, info.getSize());
soundFileLoader->close();
if(soundFileLoader!=NULL){
soundFileLoader->close();
delete soundFileLoader;
soundFileLoader= NULL;
}
delete soundFileLoader;
soundFileLoader= NULL;
}
// =====================================================