From patchwork Sun Jun 19 11:28:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: nihil-admirari X-Patchwork-Id: 36333 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp1095521pzb; Sun, 19 Jun 2022 04:29:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tOm3yJleGxj/qm/OwIY5/LuW9w8a7fhrafv9c7CkK+Eii5pBM9w1Gzzyoqt4sFp7IyuaY9 X-Received: by 2002:a05:6402:350b:b0:42f:d079:647f with SMTP id b11-20020a056402350b00b0042fd079647fmr22487621edd.321.1655638161128; Sun, 19 Jun 2022 04:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655638161; cv=none; d=google.com; s=arc-20160816; b=aWlJLXbGLA3NIQOKbgsZ0TxZrYdgjQTJIUl7QMr4CwWqzpC1fM4WPaCXGiMqVaiTX3 0vjGFB7QaApTZjShrlwzzSK4R3yv8JKDYRwELKNAqR7Y+cJfiQlh6yQ2Vn2Uvx760uRm BYFVUPFt9ViI39/56fBy/5yw/k57jsY04hlZTgQyQ1j54fmV2ZlFYY8GuFiw8zFOWIwY ne9e+nhauehozFM8oUzevW6UdfeeuJ3CaLoVhge7fNX5LM5AJabVt7J5vUIVhk84FT7G y6CM98iplZID5jPMU6YTvUa/6GTLe32WeJlrJuhBsRB9JHcS3gOCyYGefom2b630F47f yt9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=NXjui18ngym9y5OxFjVraA98Od2QtZAw4J5z9g3IVTY=; b=z4rTfYxOMLjydVFd5iW4LD8p0B5XIKFjx7WfCx5hfXhRpy+g1OREsZ5VkTlB6X04C3 I2lbA8V0qcTr58ChSi4E8sWKnoTDCAGdQAN67lCM0bsVsqYPbHKldOK6Q/wrFqP1brRh aZYTmAHc2IOuh6cBDD9tI9eWcToMhmUztwlDTBJekMwak7uaNXSPrVAUI3bE18Cgx9iT E4lyBXa6xPo8aHpMS7KJAtIGIPlh3Lzrq0fDqMZb3Vn39l37m33xaq1fGHWaAKoilX74 KuCKzlsA42EylUyVOYkkFlmTSTeNXm4cojKi77RmI9K5IDfybBM4iF4j1cizhWIhYBZj hzXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@mailo.com header.s=mailo header.b=SXIR8DN+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dt20-20020a170907729400b0071208433c4bsi7714982ejc.54.2022.06.19.04.29.20; Sun, 19 Jun 2022 04:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@mailo.com header.s=mailo header.b=SXIR8DN+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6565D68B5E3; Sun, 19 Jun 2022 14:28:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: eHDCS6meI8al --- 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; }