1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

demux_null: fix segfault with --cache enabled

stream->info can be NULL if it's the cache wrapper. To be fair,
stream->info is considered private API anyway. So don't access it, but
check the URL instead.
This commit is contained in:
wm4 2016-03-05 00:56:55 +01:00
parent 740b7013ba
commit fb2f8abaaa

View File

@ -21,7 +21,7 @@
static int try_open_file(struct demuxer *demux, enum demux_check check)
{
if (strcmp(demux->stream->info->name, "null") != 0 &&
if (!bstr_startswith0(bstr0(demux->filename), "null://") &&
check != DEMUX_CHECK_REQUEST)
return -1;
return 0;