diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 7cbd690ee6..3fa1b289a0 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -123,6 +123,9 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type) FILE *f; char line[CHANNEL_LINE_LEN], *colon; + if (!filename) + return NULL; + int fields, cnt, pcnt, k; int has8192, has0; dvb_channel_t *ptr, *tmp, chn; @@ -799,11 +802,11 @@ dvb_config_t *dvb_get_config(void) break; } - if((access(conf_file, F_OK | R_OK) != 0)) { + if(conf_file && (access(conf_file, F_OK | R_OK) != 0)) { conf_file = talloc_steal(talloc_ctx, mp_find_user_config_file("channels.conf")); - if((access(conf_file, F_OK | R_OK) != 0)) { + if(conf_file && (access(conf_file, F_OK | R_OK) != 0)) { conf_file = talloc_steal(talloc_ctx, mp_find_global_config_file("channels.conf")); } diff --git a/sub/ass_mp.c b/sub/ass_mp.c index ae069662c6..2312eaeff5 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -262,7 +262,7 @@ void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts) char *default_font = mp_find_user_config_file("subfont.ttf"); char *config = mp_find_config_file("fonts.conf"); - if (!mp_path_exists(default_font)) { + if (default_font && !mp_path_exists(default_font)) { talloc_free(default_font); default_font = NULL; } @@ -334,7 +334,8 @@ ASS_Library *mp_ass_init(struct MPOpts *opts) char *path = mp_find_user_config_file("fonts"); priv = ass_library_init(); ass_set_message_cb(priv, message_callback, NULL); - ass_set_fonts_dir(priv, path); + if (path) + ass_set_fonts_dir(priv, path); ass_set_extract_fonts(priv, opts->use_embedded_fonts); talloc_free(path); return priv;