mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 08:42:39 +00:00
avfilter/af_ladspa: check return value of getenv()
This commit is contained in:
parent
683a1599d4
commit
fdac3c80ac
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user