summaryrefslogtreecommitdiffstats
path: root/mpvcore/playlist_parser.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-12 17:19:20 +0200
committerwm4 <wm4@nowhere>2013-10-12 18:57:02 +0200
commit38874b2f2e3a5e0473bada789ef04af632e27ecb (patch)
treeece6e746005cf77feb3efba46c43029c80d72df2 /mpvcore/playlist_parser.c
parent7ce464bef9c8ef13ca8343f24d126c468086a60f (diff)
downloadmpv-38874b2f2e3a5e0473bada789ef04af632e27ecb.tar.bz2
mpv-38874b2f2e3a5e0473bada789ef04af632e27ecb.tar.xz
playlist: check for NULL on caller site
Letting some playlist functions randomly accept NULL, while others do not isn't such a good idea.
Diffstat (limited to 'mpvcore/playlist_parser.c')
-rw-r--r--mpvcore/playlist_parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpvcore/playlist_parser.c b/mpvcore/playlist_parser.c
index 0b3be14716..7c77760df4 100644
--- a/mpvcore/playlist_parser.c
+++ b/mpvcore/playlist_parser.c
@@ -648,7 +648,8 @@ struct playlist *playlist_parse_file(const char *file, struct MPOpts *opts)
struct playlist *ret = do_parse(stream, true);
free_stream(stream);
- playlist_add_base_path(ret, mp_dirname(file));
+ if (ret)
+ playlist_add_base_path(ret, mp_dirname(file));
return ret;