From 5249cccfcfb6c345a40dff2dee464d287fc69605 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Sep 2013 19:56:15 +0200 Subject: Config path functions can return NULL It's quite unlikely, but functions like mp_find_user_config_file() can return NULL, e.g. if $HOME is unset. Fix all the code that didn't check for this correctly yet. --- audio/filter/af_export.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'audio') diff --git a/audio/filter/af_export.c b/audio/filter/af_export.c index b4286c0e62..3a6f808a34 100644 --- a/audio/filter/af_export.c +++ b/audio/filter/af_export.c @@ -99,6 +99,12 @@ static int control(struct af_instance* af, int cmd, void* arg) for(i = 1; i < af->data->nch; i++) s->buf[i] = (uint8_t *)s->buf[0] + i*s->sz*af->data->bps; + if (!s->filename) { + mp_msg(MSGT_AFILTER, MSGL_FATAL, "[export] No filename set.\n", + s->filename); + return AF_ERROR; + } + // Init memory mapping s->fd = open(s->filename, O_RDWR | O_CREAT | O_TRUNC, 0640); mp_msg(MSGT_AFILTER, MSGL_INFO, "[export] Exporting to file: %s\n", s->filename); -- cgit v1.2.3