aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-06-21 21:34:18 +0200
committerPaul B Mahol <onemda@gmail.com>2020-06-21 21:35:40 +0200
commitfdac3c80ac65f6c6fb2fedae7d6236044ba531c5 (patch)
tree0b52a446513beaa2708150c358543734bcb84dba
parent683a1599d449ca434466742ba73371d2763bc7b9 (diff)
downloadffmpeg-fdac3c80ac65f6c6fb2fedae7d6236044ba531c5.tar.gz
avfilter/af_ladspa: check return value of getenv()
-rw-r--r--libavfilter/af_ladspa.c5
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);
}