diff options
author | Max Kellermann <max@duempel.org> | 2009-11-01 15:34:12 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-01 15:34:12 +0100 |
commit | ad01e1249b57bd270c469b7aa4f42237d3381d86 (patch) | |
tree | 3179ab9fdb6e6a68655e0791af8f895992f42774 /src | |
parent | 6ef428af2e554089bc3ba4104b714cfb36bfc719 (diff) | |
download | mpd-ad01e1249b57bd270c469b7aa4f42237d3381d86.tar.gz mpd-ad01e1249b57bd270c469b7aa4f42237d3381d86.tar.xz mpd-ad01e1249b57bd270c469b7aa4f42237d3381d86.zip |
decoder_api: check decoder==NULL in decoder_read()
It's legal to pass decoder=NULL to decoder_read(). Add a check.
Diffstat (limited to '')
-rw-r--r-- | src/decoder_api.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c index f1ce0f5f7..7681b7b85 100644 --- a/src/decoder_api.c +++ b/src/decoder_api.c @@ -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 || |