diff options
author | Romain Bignon <romain@peerfuse.org> | 2010-05-31 22:11:59 +0200 |
---|---|---|
committer | Romain Bignon <romain@peerfuse.org> | 2010-05-31 22:11:59 +0200 |
commit | b571ba27a46d7e405eb161e60d675aba7b4fd265 (patch) | |
tree | 5bf326c3794176dfd66516f8c80aef37bfa97df9 /src | |
parent | de8f2739c2977ffb042bfd9c36630fe6f187901f (diff) | |
download | mpd-b571ba27a46d7e405eb161e60d675aba7b4fd265.tar.gz mpd-b571ba27a46d7e405eb161e60d675aba7b4fd265.tar.xz mpd-b571ba27a46d7e405eb161e60d675aba7b4fd265.zip |
fix crash when decoder is NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder/vorbis_decoder_plugin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/decoder/vorbis_decoder_plugin.c b/src/decoder/vorbis_decoder_plugin.c index 9e63831ef..0a3944ad6 100644 --- a/src/decoder/vorbis_decoder_plugin.c +++ b/src/decoder/vorbis_decoder_plugin.c @@ -29,7 +29,7 @@ #include <tremor/ivorbisfile.h> /* Macros to make Tremor's API look like libogg. Tremor always returns host-byte-order 16-bit signed data, and uses integer - milliseconds where libogg uses double seconds. + milliseconds where libogg uses double seconds. */ #define ov_read(VF, BUFFER, LENGTH, BIGENDIANP, WORD, SGNED, BITSTREAM) \ ov_read(VF, BUFFER, LENGTH, BITSTREAM) @@ -79,7 +79,7 @@ static int ogg_seek_cb(void *data, ogg_int64_t offset, int whence) struct vorbis_input_stream *vis = data; return vis->seekable && - decoder_get_command(vis->decoder) != DECODE_COMMAND_STOP && + (!vis->decoder || decoder_get_command(vis->decoder) != DECODE_COMMAND_STOP) && input_stream_seek(vis->input_stream, offset, whence, NULL) ? 0 : -1; } |