diff options
author | wm4 <wm4@nowhere> | 2013-02-08 23:50:21 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-02-09 00:21:18 +0100 |
commit | c1ddfb59076e9b568484b97f10b4eadeb48384e3 (patch) | |
tree | e8fb4e0f60c810cc834954f9c5b138b897ec0ac0 /stream/stream_dvb.c | |
parent | a36e03781c0bbfaae4a04f3b57db4df5040d31d0 (diff) | |
download | mpv-c1ddfb59076e9b568484b97f10b4eadeb48384e3.tar.bz2 mpv-c1ddfb59076e9b568484b97f10b4eadeb48384e3.tar.xz |
Check return values of some mp_find_..._config_file function calls for NULL
Diffstat (limited to 'stream/stream_dvb.c')
-rw-r--r-- | stream/stream_dvb.c | 7 |
1 files changed, 5 insertions, 2 deletions
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")); } |