diff options
author | wm4 <wm4@nowhere> | 2015-05-09 15:37:05 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-09 15:37:05 +0200 |
commit | 34ee78f2cba0510cc37162e89cbdc9d4a9514f92 (patch) | |
tree | 1669b732c0103f216d2a4de13ebc6b973aad9c90 | |
parent | 04c02796bd371e65f81a92b853658b8fbadb7ad5 (diff) | |
download | mpv-34ee78f2cba0510cc37162e89cbdc9d4a9514f92.tar.bz2 mpv-34ee78f2cba0510cc37162e89cbdc9d4a9514f92.tar.xz |
player: avoid undefined behavior when resumign DVD/BD playback
These device options can be NULL, and NULL can't be passed for %s.
-rw-r--r-- | player/configfiles.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/player/configfiles.c b/player/configfiles.c index 984a0fd02e..6806938a1a 100644 --- a/player/configfiles.c +++ b/player/configfiles.c @@ -184,10 +184,10 @@ static char *mp_get_playback_resume_config_filename(struct mpv_global *global, realpath = mp_path_join(tmp, cwd, fname); } } - if (bstr_startswith0(bfname, "dvd://")) + if (bstr_startswith0(bfname, "dvd://") && opts->dvd_device) realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->dvd_device); - if (bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") || - bstr_startswith0(bfname, "bluray://")) + if ((bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") || + bstr_startswith0(bfname, "bluray://")) && opts->bluray_device) realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->bluray_device); uint8_t md5[16]; av_md5_sum(md5, realpath, strlen(realpath)); |