aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-01 15:34:12 +0100
committerMax Kellermann <max@duempel.org>2009-11-01 15:34:12 +0100
commitad01e1249b57bd270c469b7aa4f42237d3381d86 (patch)
tree3179ab9fdb6e6a68655e0791af8f895992f42774 /src
parent6ef428af2e554089bc3ba4104b714cfb36bfc719 (diff)
downloadmpd-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 'src')
-rw-r--r--src/decoder_api.c3
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 ||