aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/audioOutput.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/audioOutput.c b/src/audioOutput.c
index 964042597..ba9032713 100644
--- a/src/audioOutput.c
+++ b/src/audioOutput.c
@@ -189,8 +189,9 @@ static void convertAudioFormat(AudioOutput * audioOutput,
&(audioOutput->outAudioFormat));
if (size > audioOutput->convBufferLen) {
- audioOutput->convBuffer =
- xrealloc(audioOutput->convBuffer, size);
+ if (audioOutput->convBuffer != NULL)
+ free(audioOutput->convBuffer);
+ audioOutput->convBuffer = xmalloc(size);
audioOutput->convBufferLen = size;
}