diff options
-rw-r--r-- | src/pcm_buffer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pcm_buffer.c b/src/pcm_buffer.c index a71a10cb3..c22157352 100644 --- a/src/pcm_buffer.c +++ b/src/pcm_buffer.c @@ -19,6 +19,7 @@ #include "config.h" #include "pcm_buffer.h" +#include "poison.h" /** * Align the specified size to the next 8k boundary. @@ -41,6 +42,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); |