mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 13:14:36 +00:00
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: 34a04d0567
This commit is contained in:
parent
8faa0abae8
commit
bcdc5c40e7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user