Fixed: Possible crash when queued buffers are already empty

--HG--
branch : develop
feature/pipeline-tools
Nimetu 6 years ago
parent 1e6027c970
commit 1635330a14

@ -194,7 +194,7 @@ uint CSourceAL::countStreamingBuffers() const
// a bit ugly here, but makes a much easier/simpler implementation on both drivers // a bit ugly here, but makes a much easier/simpler implementation on both drivers
ALint buffersProcessed; ALint buffersProcessed;
alGetSourcei(_Source, AL_BUFFERS_PROCESSED, &buffersProcessed); alGetSourcei(_Source, AL_BUFFERS_PROCESSED, &buffersProcessed);
while (buffersProcessed) while (buffersProcessed && !_QueuedBuffers.empty())
{ {
ALuint bufferName = _QueuedBuffers.front()->bufferName(); ALuint bufferName = _QueuedBuffers.front()->bufferName();
alSourceUnqueueBuffers(_Source, 1, &bufferName); alSourceUnqueueBuffers(_Source, 1, &bufferName);

Loading…
Cancel
Save