mirror of
https://github.com/glest/glest-source.git
synced 2025-10-01 18:06:44 +02:00
- coverity based bug fixes - round #1
This commit is contained in:
@@ -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__));
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
|
Reference in New Issue
Block a user