From 130659e856eac7520fc1b32c0a7552ce354df66b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 11 Nov 2008 15:55:28 +0100 Subject: 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. --- src/decoder_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3