Skip to content

Commit

Permalink
libavfilter/vf_frei0r.c: Use UTF-8 version of getenv()
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Storsjö <martin@martin.st>
  • Loading branch information
nihil-admirari authored and mstorsjo committed Jun 21, 2022
1 parent c381f54 commit 69364a0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions libavfilter/vf_frei0r.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/getenv_utf8.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
Expand Down Expand Up @@ -204,7 +205,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
}

/* see: http://frei0r.dyne.org/codedoc/html/group__pluglocations.html */
if ((path = av_strdup(getenv("FREI0R_PATH")))) {
if (path = getenv_dup("FREI0R_PATH")) {
#ifdef _WIN32
const char *separator = ";";
#else
Expand All @@ -231,12 +232,17 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
if (ret < 0)
return ret;
}
if (!s->dl_handle && (path = getenv("HOME"))) {
if (!s->dl_handle && (path = getenv_utf8("HOME"))) {
char *prefix = av_asprintf("%s/.frei0r-1/lib/", path);
if (!prefix)
return AVERROR(ENOMEM);
if (!prefix) {
ret = AVERROR(ENOMEM);
goto home_path_end;
}
ret = load_path(ctx, &s->dl_handle, prefix, dl_name);
av_free(prefix);

home_path_end:
freeenv_utf8(path);
if (ret < 0)
return ret;
}
Expand Down

0 comments on commit 69364a0

Please sign in to comment.