aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-11 15:55:28 +0100
committerMax Kellermann <max@duempel.org>2008-11-11 15:55:28 +0100
commit130659e856eac7520fc1b32c0a7552ce354df66b (patch)
tree28b9c61106eaf738fe9942788ed517424cc285ac
parentff1acefb2115252cb27f0d0dc6219a527e258049 (diff)
downloadmpd-130659e856eac7520fc1b32c0a7552ce354df66b.tar.gz
mpd-130659e856eac7520fc1b32c0a7552ce354df66b.tar.xz
mpd-130659e856eac7520fc1b32c0a7552ce354df66b.zip
decoder: fixed assertion failure for decoder==NULL in decoder_read()
The assertion on dc.state in decoder_read() was too strict: when a decoder tried to call decoder_read() from tag_dup(), the decoder state was NONE. Allow this special case.
-rw-r--r--src/decoder_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 934c7d811..d60dbb8d2 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -100,7 +100,8 @@ size_t decoder_read(struct decoder *decoder,
{
size_t nbytes;
- assert(dc.state == DECODE_STATE_START ||
+ assert(decoder == NULL ||
+ dc.state == DECODE_STATE_START ||
dc.state == DECODE_STATE_DECODE);
assert(is != NULL);
assert(buffer != NULL);