decoder_api: check decoder==NULL in decoder_read()

It's legal to pass decoder=NULL to decoder_read().  Add a check.
This commit is contained in:
Max Kellermann 2009-11-01 15:34:12 +01:00
parent 6ef428af2e
commit ad01e1249b

View File

@ -153,7 +153,8 @@ size_t decoder_read(struct decoder *decoder,
struct input_stream *is,
void *buffer, size_t length)
{
const struct decoder_control *dc = decoder->dc;
const struct decoder_control *dc =
decoder != NULL ? decoder->dc : NULL;
size_t nbytes;
assert(decoder == NULL ||