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 47D6345201 for ; Thu, 13 Apr 2023 01:54:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5FABB68BB5A; Thu, 13 Apr 2023 04:54:34 +0300 (EEST) Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9069A689AEC for ; Thu, 13 Apr 2023 04:54:27 +0300 (EEST) Received: by mail-oi1-f180.google.com with SMTP id bl22so27053469oib.11 for ; Wed, 12 Apr 2023 18:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681350866; x=1683942866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HTYo4YRCw51m3Mor85MtNR6C+ak9jkN8GVaLjWSTyCI=; b=KdF1bIz7UCPB8YSXEyI1FEgyl9FlZnpZeaCPiBTEqnS3dij/ndbjQQ4IbAYuXvyK7o VNw5qgOzy9QjCDJD+fs8VeyC3VyYNAMO984xgh+8OlGhf7gDos686ibwhHGVr8XzlZ5R UFtLehfObi2ema8n2xjbDolcXYROO/sP7nOsNhs4p8ISR9SU5+A02w9WexM32P5l+xda IXJ/I8gkcUJV9GlPP71bqfNRzNlgHrQGqG+i7cFauDuZeuAeZirVpvTj/79lR76OHHk5 9alPWX4oNfz+C0W27x0EvX6XhbQvbbc4cjxqg6pN0w395e77jQKSK8ftrh+RnJ9tmnZd pHSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681350866; x=1683942866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HTYo4YRCw51m3Mor85MtNR6C+ak9jkN8GVaLjWSTyCI=; b=g2P8rlbo454QElBBwD+HBTUsolDM/a+zzBYebyJJSA7JdqWYfMC3nnxaxEDaByCD1T IVURNKw1jJuarDAd7xxpIF9W/NOqA3MPilcKrs36jtMMvgVx7LEP7Vb+stnlZFDgtFpJ RjUei06pxNg7AhEFrwyNj7P7SkF9TVUb5mYGpK+RY0bSLGsEGpi0xfElxNF+cjPc3eIF 2hqueUlaOmDixawocOT37aRI2qgpaQL2n9iogm/0nBSihHutdMycc6rEWvsD2bQ/a8Kr k/+RHFrc3NIzMEQlr2QnJmDTb0ZrhYkiPhKuDZnyuGhOQ/7fynPf0isRUwkyVcZ9kZGW 3ROQ== X-Gm-Message-State: AAQBX9e/AAVBfG/eC9xpstkU0aMwA4uF2HrRcNO0XMQy/1hc6R+TtQC3 1I1KB1yffdmblbxm+tY6MjUYc3CGxKI= X-Google-Smtp-Source: AKy350Zmr4cZZUMdpQTBNPmatkDkeVP+CcU9qHjcx3sgvDsZBlRZeJR537aDyzLw5dRn/p6/YOndqQ== X-Received: by 2002:a05:6808:b13:b0:386:a04e:f84 with SMTP id s19-20020a0568080b1300b00386a04e0f84mr384842oij.17.1681350865911; Wed, 12 Apr 2023 18:54:25 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id p9-20020acabf09000000b00383cc29d6b2sm170342oif.51.2023.04.12.18.54.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 18:54:25 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Apr 2023 22:53:56 -0300 Message-Id: <20230413015356.44961-2-jamrial@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230413015356.44961-1-jamrial@gmail.com> References: <20230413015356.44961-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avutil/wchar_filename: propagate MultiByteToWideChar() failures 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: Don't return success if the string could not be converted. Signed-off-by: James Almer --- libavutil/wchar_filename.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/wchar_filename.h b/libavutil/wchar_filename.h index 9a04a069f1..27b93d0f89 100644 --- a/libavutil/wchar_filename.h +++ b/libavutil/wchar_filename.h @@ -32,7 +32,8 @@ static inline int utf8towchar(const char *filename_utf8, wchar_t **filename_w) num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0); if (num_chars <= 0) { *filename_w = NULL; - return 0; + errno = EINVAL; + return -1; } *filename_w = (wchar_t *)av_calloc(num_chars, sizeof(wchar_t)); if (!*filename_w) { -- 2.40.0 _______________________________________________ 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".