aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/flanger.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-21 03:27:51 -0700
committerChris Robinson <[email protected]>2016-05-21 03:27:51 -0700
commit2e7ec3979aec71f11c45b737b77d58978cbee7e2 (patch)
treec931d2f9b55cc6803a00896f92793a58de8fdc11 /Alc/effects/flanger.c
parent7bf64eaee0788b7eb64c7410384a9ee66f75c4ce (diff)
Avoid using realloc in a number of places
Diffstat (limited to 'Alc/effects/flanger.c')
-rw-r--r--Alc/effects/flanger.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c
index 7b55977e..f18b2b0f 100644
--- a/Alc/effects/flanger.c
+++ b/Alc/effects/flanger.c
@@ -57,7 +57,7 @@ typedef struct ALflangerState {
static ALvoid ALflangerState_Destruct(ALflangerState *state)
{
- free(state->SampleBuffer[0]);
+ al_free(state->SampleBuffer[0]);
state->SampleBuffer[0] = NULL;
state->SampleBuffer[1] = NULL;
ALeffectState_Destruct(STATIC_CAST(ALeffectState,state));
@@ -73,10 +73,10 @@ static ALboolean ALflangerState_deviceUpdate(ALflangerState *state, ALCdevice *D
if(maxlen != state->BufferLength)
{
- void *temp;
-
- temp = realloc(state->SampleBuffer[0], maxlen * sizeof(ALfloat) * 2);
+ void *temp = al_calloc(16, maxlen * sizeof(ALfloat) * 2);
if(!temp) return AL_FALSE;
+
+ al_free(state->SampleBuffer[0]);
state->SampleBuffer[0] = temp;
state->SampleBuffer[1] = state->SampleBuffer[0] + maxlen;