From 774417f12f91e49ef16d763538da47215c0119b2 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Fri, 21 Nov 2008 20:26:57 +0100
Subject: [PATCH] decoder: ignore decoder_data() calls with length==0

Pushing buffers with a zero length into the MPD core causes failures;
don't let them pass beyond the decoder plugi API.
---
 src/decoder_api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/decoder_api.c b/src/decoder_api.c
index 7df94e02f..a85a52e71 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -194,7 +194,8 @@ decoder_data(struct decoder *decoder,
 	assert(dc.state == DECODE_STATE_DECODE);
 
 	if (dc.command == DECODE_COMMAND_STOP ||
-	    dc.command == DECODE_COMMAND_SEEK)
+	    dc.command == DECODE_COMMAND_SEEK ||
+	    length == 0)
 		return dc.command;
 
 	if (is != NULL && !decoder->stream_tag_sent) {