aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcm_buffer.c')
-rw-r--r--src/pcm_buffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pcm_buffer.c b/src/pcm_buffer.c
index 60a699b20..4b1eb875a 100644
--- a/src/pcm_buffer.c
+++ b/src/pcm_buffer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "config.h"
#include "pcm_buffer.h"
+#include "poison.h"
/**
* Align the specified size to the next 8k boundary.
@@ -45,6 +47,9 @@ pcm_buffer_get(struct pcm_buffer *buffer, size_t size)
buffer->size = align_8k(size);
buffer->buffer = g_malloc(buffer->size);
+ } else {
+ /* discard old buffer contents */
+ poison_undefined(buffer->buffer, buffer->size);
}
assert(buffer->size >= size);