Commit ad01e124 authored by Max Kellermann's avatar Max Kellermann

decoder_api: check decoder==NULL in decoder_read()

It's legal to pass decoder=NULL to decoder_read(). Add a check.
parent 6ef428af
...@@ -153,7 +153,8 @@ size_t decoder_read(struct decoder *decoder, ...@@ -153,7 +153,8 @@ size_t decoder_read(struct decoder *decoder,
struct input_stream *is, struct input_stream *is,
void *buffer, size_t length) 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; size_t nbytes;
assert(decoder == NULL || assert(decoder == NULL ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment