From 1635330a14f695770ac92aeae7585ed0580608c4 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 18 Feb 2019 22:22:25 +0200 Subject: [PATCH] Fixed: Possible crash when queued buffers are already empty --HG-- branch : develop --- code/nel/src/sound/driver/openal/source_al.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/sound/driver/openal/source_al.cpp b/code/nel/src/sound/driver/openal/source_al.cpp index 825d9f1e9..b35dbe201 100644 --- a/code/nel/src/sound/driver/openal/source_al.cpp +++ b/code/nel/src/sound/driver/openal/source_al.cpp @@ -194,7 +194,7 @@ uint CSourceAL::countStreamingBuffers() const // a bit ugly here, but makes a much easier/simpler implementation on both drivers ALint buffersProcessed; alGetSourcei(_Source, AL_BUFFERS_PROCESSED, &buffersProcessed); - while (buffersProcessed) + while (buffersProcessed && !_QueuedBuffers.empty()) { ALuint bufferName = _QueuedBuffers.front()->bufferName(); alSourceUnqueueBuffers(_Source, 1, &bufferName);