aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_buffer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-13 19:15:18 +0100
committerMax Kellermann <max@duempel.org>2012-02-13 19:15:18 +0100
commitc616165f81a07feb42b96b6078885b2a10c8908f (patch)
treed21c8c77c007e6de0bf50c6daf8f5998d8d978fd /src/pcm_buffer.c
parentedac498d03b9de59d4e55081c92604ff2447a298 (diff)
parent103832742d4ef2b6bb86d287b8557ab3e64dba21 (diff)
downloadmpd-c616165f81a07feb42b96b6078885b2a10c8908f.tar.gz
mpd-c616165f81a07feb42b96b6078885b2a10c8908f.tar.xz
mpd-c616165f81a07feb42b96b6078885b2a10c8908f.zip
Merge branch 'v0.16.x'
Conflicts: NEWS configure.ac src/decoder/ffmpeg_decoder_plugin.c test/read_tags.c
Diffstat (limited to 'src/pcm_buffer.c')
-rw-r--r--src/pcm_buffer.c5
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);