- 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

@@ -182,6 +182,7 @@ StreamSoundSource::StreamSoundSource()
sound = 0;
fadeState = NoFading;
format = 0;
fade = 0;
alGenBuffers(STREAMFRAGMENTS, buffers);
SoundPlayerOpenAL::checkAlError(string(__FILE__) + string(" ") + string(__FUNCTION__) + string(" ") + intToStr(__LINE__));
}

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;
}
// =====================================================