- fixed some bugs discovered by coverity scan

This commit is contained in:
SoftCoder
2016-01-20 21:34:23 -08:00
parent 0c12b5fb8c
commit d6dbb187cc
8 changed files with 150 additions and 128 deletions

View File

@@ -85,6 +85,7 @@ private:
string fileName;
public:
OggSoundFileLoader();
virtual void open(const string &path, SoundInfo *soundInfo);
virtual uint32 read(int8 *samples, uint32 size);
virtual void close();

View File

@@ -254,6 +254,9 @@ int zipfile_tool(int argc, const char *argv[]) {
uint n = BUF_SIZE - stream.avail_out;
if (fwrite(s_outbuf, 1, n, pOutfile) != n) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Failed writing to output file!\n");
if(pInfile) fclose(pInfile);
if(pOutfile) fclose(pOutfile);
return EXIT_FAILURE;
}
stream.next_out = s_outbuf;

View File

@@ -107,7 +107,7 @@ public:
base_thread->signalQuit();
sleep(10);
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,(base_thread != NULL ? base_thread->getUniqueID().c_str() : "n/a"));
if(Thread::getEnableVerboseMode()) printf("!!!! cleanupPendingThread Line: %d thread = %p [%s]\n",__LINE__,thread,base_thread->getUniqueID().c_str());
if(base_thread->getRunningStatus() == true || base_thread->getExecutingTask() == true) {

View File

@@ -201,6 +201,11 @@ void WavSoundFileLoader::restart(){
// Ogg Sound File Loader
// =======================================
OggSoundFileLoader::OggSoundFileLoader() {
vf = NULL;
f = NULL;
}
void OggSoundFileLoader::open(const string &path, SoundInfo *soundInfo){
fileName = path;