aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r--OpenAL32/alBuffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index ac3a85af..9e245eef 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -161,8 +161,9 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
break;
}
- buffer->buffer = (ALuint)ALTHUNK_ADDENTRY(buffer);
- err = InsertUIntMapEntry(&device->BufferMap, buffer->buffer, buffer);
+ err = ALTHUNK_ADDENTRY(buffer, &buffer->buffer);
+ if(err == AL_NO_ERROR)
+ err = InsertUIntMapEntry(&device->BufferMap, buffer->buffer, buffer);
if(err != AL_NO_ERROR)
{
ALTHUNK_REMOVEENTRY(buffer->buffer);