From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9200F43632 for ; Sun, 19 Jun 2022 11:29:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3459968B5D7; Sun, 19 Jun 2022 14:28:46 +0300 (EEST) Received: from msg-4.mailo.com (ip-15.mailobj.net [213.182.54.15]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E0BAF68B39A for ; Sun, 19 Jun 2022 14:28:36 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1655638116; bh=zm3Y687yoSQsUbcPgxmKDx+bkEMLwYe0regHRBhlmvI=; h=X-EA-Auth:From:To:Subject:Date:Message-Id:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; b=SXIR8DN+/5VhiidI+W1fYNNRLzjzYjtFPIdlmFk1ujsppQ/pXZpBmUf6aLcm/6UFz rnIC7LwcsEMINuopY4TdAcbG6TquDbrnMVHulmT0k8mSgqQqPNzUutNsMqFM1LvQ9K R+CbzuFPU4mgwAYSVWy64v36ShkheoHtaOYQC6C4= Received: by b-1.in.mailobj.net [192.168.90.11] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 19 Jun 2022 13:28:35 +0200 (CEST) X-EA-Auth: S4sTcPyoLzVtVmlFbxAolccFUHZu6XkSD80fWxHpul5f/rDHoys5HMI6OGYsonJvJfkXOGGc5XKhO0d4HHljjJtsW2X43StrPSdKV4/3+8A= From: Nil Admirari To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 Jun 2022 14:28:27 +0300 Message-Id: <20220619112827.4183-5-nil-admirari@mailo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220619112827.4183-1-nil-admirari@mailo.com> References: <20220619112827.4183-1-nil-admirari@mailo.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v18 5/5] libavfilter/vf_frei0r.c: Use UTF-8 version of getenv() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavfilter/vf_frei0r.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index f11ae6e55c..9a7a11604a 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -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" @@ -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_utf8("FREI0R_PATH"))) { #ifdef _WIN32 const char *separator = ";"; #else @@ -227,16 +228,21 @@ static av_cold int frei0r_init(AVFilterContext *ctx, } check_path_end: - av_free(path); + freeenv_utf8(path); 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; } -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".