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 8A6EC42F42 for ; Wed, 15 Jun 2022 20:04:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7B4F668B73B; Wed, 15 Jun 2022 23:04:05 +0300 (EEST) Received: from msg-6.mailo.com (ip-16.mailobj.net [213.182.54.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C7A0468B6FC for ; Wed, 15 Jun 2022 23:03:56 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1655323436; bh=p9jxFt4rVMw7lLn6uKQfLHnRCrr8GugwXB91pqjkC1Q=; h=X-EA-Auth:From:To:Subject:Date:Message-Id:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; b=Kx/Y4XDlq/oVaoWqKycc/SaVzOM/EM6sqzNZ+44AFHi2BccU96SaMMVowWwa0oqLG dybMX8ENfk1O5PwBTD+N/7KfNEYYS0xkW4oIZJRC0EARCjDwH54uTbHcHKkmsAW/bB ew8dp2le+Hy7ypvp9QBplZLcLVw2SuRDpxgHx3sE= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Wed, 15 Jun 2022 22:03:56 +0200 (CEST) X-EA-Auth: z0T4atKpDHBEIv9Dpsb5t3CeQCPfMHZpIrFNjMbnhhaT2kE5kRxBw8k60+FqQkRTYBQ6+2AlJWDT24XWXVuPwfrPMS3S5BYSDRU/efIRUVk= From: Nil Admirari To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jun 2022 23:03:44 +0300 Message-Id: <20220615200344.17211-5-nil-admirari@mailo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220615200344.17211-1-nil-admirari@mailo.com> References: <20220615200344.17211-1-nil-admirari@mailo.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v16 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index f11ae6e55c..727e96561a 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 @@ -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: + av_free(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".