summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-11-20 21:59:54 +0100
committersfan5 <sfan5@live.de>2023-11-20 22:01:34 +0100
commitbcdc5c40e71147fdacb7335471196cef3e917ec0 (patch)
tree01e85418c30170af901f7a1860a776dfd8580358 /player/command.c
parent8faa0abae8270aedee8972070cd7c83b1cb0a095 (diff)
downloadmpv-bcdc5c40e71147fdacb7335471196cef3e917ec0.tar.bz2
mpv-bcdc5c40e71147fdacb7335471196cef3e917ec0.tar.xz
command: add missing null check to event handler
Unclear if there are other situations but at least using --force-media-title this can be called without a playing file, causing a segfault. fixes: 34a04d05676
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index e928eeda34..8bff0cd6f9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -6900,7 +6900,7 @@ static void command_event(struct MPContext *mpctx, int event, void *arg)
if (event == MP_EVENT_METADATA_UPDATE) {
struct playlist_entry *const pe = mpctx->playing;
- if (!pe->title) {
+ if (pe && !pe->title) {
const char *const name = find_non_filename_media_title(mpctx);
if (name && name[0]) {
pe->title = talloc_strdup(pe, name);