diff options
-rw-r--r-- | OpenAL32/alSource.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index cf859e00..e7c51a66 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -1748,11 +1748,15 @@ ALAPI ALvoid ALAPIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint ALBufferList = ALSource->queue; ALSource->queue = ALBufferList->next; - // Record name of buffer - buffers[i] = ALBufferList->buffer->buffer; - // Decrement buffer reference counter if(ALBufferList->buffer) + { + // Record name of buffer + buffers[i] = ALBufferList->buffer->buffer; + // Decrement buffer reference counter ALBufferList->buffer->refcount--; + } + else + buffers[i] = 0; // Release memory for buffer list item free(ALBufferList); |