aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-09-26 18:21:03 -0700
committerChris Robinson <[email protected]>2012-09-26 18:21:03 -0700
commit68faef5b84c06c997e65027656f659e16671ba3a (patch)
tree3a1130a338107500ab095681f56623ce8d75e0f8
parentabf1309fb6e737445cd67888865cc6fcd931920f (diff)
Ensure the device's default effect slot is properly aligned
-rw-r--r--Alc/ALc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index dcbd848f..c1b698cc 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2647,7 +2647,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
if(deviceName && (!deviceName[0] || strcasecmp(deviceName, alcDefaultName) == 0 || strcasecmp(deviceName, "openal-soft") == 0))
deviceName = NULL;
- device = al_calloc(16, sizeof(ALCdevice)+sizeof(ALeffectslot));
+ device = al_calloc(16, sizeof(ALCdevice)+15+sizeof(ALeffectslot));
if(!device)
{
alcSetError(NULL, ALC_OUT_OF_MEMORY);
@@ -2833,7 +2833,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
if(DefaultEffect.type != AL_EFFECT_NULL)
{
- device->DefaultSlot = (ALeffectslot*)(device+1);
+ device->DefaultSlot = (ALeffectslot*)((ALintptrEXT)(device+1)&~15);
if(InitEffectSlot(device->DefaultSlot) != AL_NO_ERROR)
{
device->DefaultSlot = NULL;