File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 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,
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,
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 }
You can’t perform that action at this time.
0 commit comments