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:
parent
6ef428af2e
commit
ad01e1249b
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user