From 70b58d79fe06581a7ca6db3feb17d5d07f8f8de6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 12 Sep 2019 12:19:07 -0700 Subject: Fix source limit check --- al/source.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'al/source.cpp') 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 srclock{context->mSourceLock}; ALCdevice *device{context->mDevice.get()}; - if(static_cast(n) >= device->SourcesMax-context->mNumSources) + if(static_cast(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(n))) -- cgit v1.2.3