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.
This commit is contained in:
Max Kellermann 2008-11-11 15:55:28 +01:00
parent ff1acefb21
commit 130659e856

View File

@ -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);