History

libavfilter/vf_frei0r.c: Use UTF-8 version of getenv()

Nil Admirari committed 4 years ago

Commit 69364a01 parent c381f541 file · +10 −4Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_frei0r.c+10−4
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include "libavutil/avstring.h"
3232 #include "libavutil/common.h"
3333 #include "libavutil/eval.h"
34+#include "libavutil/getenv_utf8.h"
3435 #include "libavutil/imgutils.h"
3536 #include "libavutil/internal.h"
3637 #include "libavutil/mathematics.h"
@@ -204,7 +205,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx, · 167 unmodified lines
204205 }
205206
206207 /* see: http://frei0r.dyne.org/codedoc/html/group__pluglocations.html */
207− if ((path = av_strdup(getenv("FREI0R_PATH")))) {
208+ if (path = getenv_dup("FREI0R_PATH")) {
208209 #ifdef _WIN32
209210 const char *separator = ";";
210211 #else
@@ -231,12 +232,17 @@ static av_cold int frei0r_init(AVFilterContext *ctx, · 20 unmodified lines
231232 if (ret < 0)
232233 return ret;
233234 }
234− if (!s->dl_handle && (path = getenv("HOME"))) {
235+ if (!s->dl_handle && (path = getenv_utf8("HOME"))) {
235236 char *prefix = av_asprintf("%s/.frei0r-1/lib/", path);
236− if (!prefix)
237− return AVERROR(ENOMEM);
237+ if (!prefix) {
238+ ret = AVERROR(ENOMEM);
239+ goto home_path_end;
240+ }
238241 ret = load_path(ctx, &s->dl_handle, prefix, dl_name);
239242 av_free(prefix);
243+
244+ home_path_end:
245+ freeenv_utf8(path);
240246 if (ret < 0)
241247 return ret;
242248 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t