From: ehofman Date: Tue, 29 Dec 2009 09:47:04 +0000 (+0000) Subject: Rearrange alut error checking a bit X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4950c96f1ce4888aac4382905201e35314b0ae83;p=simgear.git Rearrange alut error checking a bit --- diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 7b18d61f..47b43748 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -554,8 +554,8 @@ bool SGSoundMgr::load(string &samplepath, void **dbuf, int *fmt, ALfloat freqf; data = alutLoadMemoryFromFile(samplepath.c_str(), &format, &size, &freqf ); freq = (ALsizei)freqf; - if (data == NULL) { - int error = alutGetError(); + int error = alutGetError(); + if (data == NULL || error != ALUT_ERROR_NO_ERROR) { string msg = "Failed to load wav file: "; msg.append(alutGetErrorString(error)); throw sg_io_exception(msg.c_str(), sg_location(samplepath));