diff options
author | Chris Robinson <[email protected]> | 2019-09-12 12:19:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-12 12:19:07 -0700 |
commit | 70b58d79fe06581a7ca6db3feb17d5d07f8f8de6 (patch) | |
tree | e7e8ae6455f20903e177e23e7700cd5a85a4f760 | |
parent | 6ca8fadd583ade917a07da90c038ce62220593f7 (diff) |
Fix source limit check
-rw-r--r-- | al/source.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/al/source.cpp b/al/source.cpp index 38c4ff54..b9989d5d 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -2067,9 +2067,10 @@ START_API_FUNC std::unique_lock<std::mutex> srclock{context->mSourceLock}; ALCdevice *device{context->mDevice.get()}; - if(static_cast<ALuint>(n) >= device->SourcesMax-context->mNumSources) + if(static_cast<ALuint>(n) > device->SourcesMax-context->mNumSources) { - context->setError(AL_OUT_OF_MEMORY, "Exceeding %u source limit", device->SourcesMax); + context->setError(AL_OUT_OF_MEMORY, "Exceeding %u source limit (%u + %d)", + device->SourcesMax, context->mNumSources, n); return; } if(!EnsureSources(context.get(), static_cast<ALuint>(n))) |