From a2098326dac3587fb6f0869e515c07d1f9c762f8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 13 Nov 2012 21:52:24 +0100 Subject: network: fix crash with -playlist http://... The function fixup_network_stream_cache() accesses stream->opts, which is NULL in some cases when loading playlists. stream->opts is a pointer to the global MPOpts struct. For simplicity, this parameter is left NULL in some cases. Usually, this doesn't matter, because barely anything in stream/ uses MPOpts anyway. Hack-fix this for now by not accessing MPOpts and disabling the stream cache in this case. Calling open_stream() with options==NULL now basically means: do not use cache settings. --- stream/network.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stream') diff --git a/stream/network.c b/stream/network.c index f80017e75b..c324017d48 100644 --- a/stream/network.c +++ b/stream/network.c @@ -457,6 +457,8 @@ nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ) { void fixup_network_stream_cache(stream_t *stream) { struct MPOpts *opts = stream->opts; + if(!opts) + return; if(stream->streaming_ctrl->buffering) { if(opts->stream_cache_size<0) { // cache option not set, will use our computed value. -- cgit v1.2.3