diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-06-21 21:34:18 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-06-21 21:35:40 +0200 |
commit | fdac3c80ac65f6c6fb2fedae7d6236044ba531c5 (patch) | |
tree | 0b52a446513beaa2708150c358543734bcb84dba /libavfilter | |
parent | 683a1599d449ca434466742ba73371d2763bc7b9 (diff) | |
download | ffmpeg-fdac3c80ac65f6c6fb2fedae7d6236044ba531c5.tar.gz |
avfilter/af_ladspa: check return value of getenv()
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_ladspa.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c index 0d7ceb2777..ce695db9ff 100644 --- a/libavfilter/af_ladspa.c +++ b/libavfilter/af_ladspa.c @@ -469,6 +469,7 @@ static av_cold int init(AVFilterContext *ctx) } else { // argument is a shared object name char *paths = av_strdup(getenv("LADSPA_PATH")); + const char *home_path = getenv("HOME"); const char *separator = ":"; if (paths) { @@ -480,12 +481,12 @@ static av_cold int init(AVFilterContext *ctx) } av_free(paths); - if (!s->dl_handle && (paths = av_asprintf("%s/.ladspa", getenv("HOME")))) { + if (!s->dl_handle && home_path && (paths = av_asprintf("%s/.ladspa", home_path))) { s->dl_handle = try_load(paths, s->dl_name); av_free(paths); } - if (!s->dl_handle && (paths = av_asprintf("%s/.ladspa/lib", getenv("HOME")))) { + if (!s->dl_handle && home_path && (paths = av_asprintf("%s/.ladspa/lib", home_path))) { s->dl_handle = try_load(paths, s->dl_name); av_free(paths); } |