From 65a39772829b67c3dfb77aa35d51a3c35e49c050 Mon Sep 17 00:00:00 2001 From: Mohammad Alsaleh Date: Fri, 11 Oct 2013 04:24:50 +0300 Subject: mpvcore/playlist.c: Avoid NULL reference in playlist_add_base_path() Before this patch, those will cause a crash: mpv -playlist /dev/null mpv -playlist <(bla) # if the result of bla is empty Signed-off-by: Mohammad Alsaleh Signed-off-by: Stefano Pigozzi --- mpvcore/playlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvcore/playlist.c b/mpvcore/playlist.c index 3396a5d78b..818aa45a8c 100644 --- a/mpvcore/playlist.c +++ b/mpvcore/playlist.c @@ -178,7 +178,7 @@ struct playlist_entry *playlist_get_next(struct playlist *pl, int direction) void playlist_add_base_path(struct playlist *pl, bstr base_path) { - if (base_path.len == 0 || bstrcmp0(base_path, ".") == 0) + if (!pl || base_path.len == 0 || bstrcmp0(base_path, ".") == 0) return; for (struct playlist_entry *e = pl->first; e; e = e->next) { if (!mp_is_url(bstr0(e->filename))) { -- cgit v1.2.3