summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-05-01 19:57:17 +0200
committerwm4 <wm4@nowhere>2017-05-01 19:57:56 +0200
commit24f568c06858146681decb1d4be50ef68865d136 (patch)
treeeac858e011e5a1269925871d477a2b8ba3023541
parentb5b3aadf40b5a94d79b4ec3f1d3a1892eba01f6a (diff)
downloadmpv-24f568c06858146681decb1d4be50ef68865d136.tar.bz2
mpv-24f568c06858146681decb1d4be50ef68865d136.tar.xz
player: fix potential segfault when playing dvd:// with DVD disabled
Tries to access the options, which are obviously not allocated if there is no DVD support compiled. Fixes #4393.
-rw-r--r--player/configfiles.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/configfiles.c b/player/configfiles.c
index d87f83c1f7..f92d4ca96b 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -181,7 +181,7 @@ static char *mp_get_playback_resume_config_filename(struct MPContext *mpctx,
realpath = mp_path_join(tmp, cwd, fname);
}
}
- if (bstr_startswith0(bfname, "dvd://") && opts->dvd_opts->device)
+ if (bstr_startswith0(bfname, "dvd://") && opts->dvd_opts && opts->dvd_opts->device)
realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->dvd_opts->device);
if ((bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") ||
bstr_startswith0(bfname, "bluray://")) && opts->bluray_device)