diff options
Diffstat (limited to '')
-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 75b76a5d3..b0449d44e 100644 --- a/src/pcm_buffer.c +++ b/src/pcm_buffer.c @@ -32,6 +32,8 @@ align_8k(size_t size) void * pcm_buffer_get(struct pcm_buffer *buffer, size_t size) { + assert(buffer != NULL); + if (buffer->size < size) { /* free the old buffer */ g_free(buffer->buffer); @@ -40,5 +42,7 @@ pcm_buffer_get(struct pcm_buffer *buffer, size_t size) buffer->buffer = g_malloc(buffer->size); } + assert(buffer->size >= size); + return buffer->buffer; } |