diff options
Diffstat (limited to 'src/pcm_buffer.c')
-rw-r--r-- | src/pcm_buffer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pcm_buffer.c b/src/pcm_buffer.c index c22157352..4b1eb875a 100644 --- a/src/pcm_buffer.c +++ b/src/pcm_buffer.c @@ -36,6 +36,11 @@ pcm_buffer_get(struct pcm_buffer *buffer, size_t size) { assert(buffer != NULL); + if (size == 0) + /* never return NULL, because NULL would be assumed to + be an error condition */ + size = 1; + if (buffer->size < size) { /* free the old buffer */ g_free(buffer->buffer); |