Unified · Split
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include "libavutil/avstring.h" |
| 32 | 32 | #include "libavutil/common.h" |
| 33 | 33 | #include "libavutil/eval.h" |
| 34 | +#include "libavutil/getenv_utf8.h" | |
| 34 | 35 | #include "libavutil/imgutils.h" |
| 35 | 36 | #include "libavutil/internal.h" |
| 36 | 37 | #include "libavutil/mathematics.h" |
| @@ -204,7 +205,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx, · 167 unmodified lines | ||
| 204 | 205 | } |
| 205 | 206 | |
| 206 | 207 | /* 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")) { | |
| 208 | 209 | #ifdef _WIN32 |
| 209 | 210 | const char *separator = ";"; |
| 210 | 211 | #else |
| @@ -231,12 +232,17 @@ static av_cold int frei0r_init(AVFilterContext *ctx, · 20 unmodified lines | ||
| 231 | 232 | if (ret < 0) |
| 232 | 233 | return ret; |
| 233 | 234 | } |
| 234 | − if (!s->dl_handle && (path = getenv("HOME"))) { | |
| 235 | + if (!s->dl_handle && (path = getenv_utf8("HOME"))) { | |
| 235 | 236 | 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 | + } | |
| 238 | 241 | ret = load_path(ctx, &s->dl_handle, prefix, dl_name); |
| 239 | 242 | av_free(prefix); |
| 243 | + | |
| 244 | + home_path_end: | |
| 245 | + freeenv_utf8(path); | |
| 240 | 246 | if (ret < 0) |
| 241 | 247 | return ret; |
| 242 | 248 | } |