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 C0BFB42F33 for ; Mon, 16 May 2022 08:12:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 11AB0680134; Mon, 16 May 2022 11:12:19 +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 4E60768B4CA for ; Mon, 16 May 2022 11:12:12 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1652688731; bh=3foLJsj2dFLSyG3ZeKSS+wUoEemQs02GSxXUCHzVHi0=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Ix0/3jGZzWooN/XL6uvji7eCVnW6avjx285WopXeJ0ygMxQYK1IWm43WViuDhSNvO 6V8adUwhdQb1KOk8YSkuInTJ0q069CAwg2Dt2ernekf3QJ5267pQNWGE95nl2Mgy08 adfXleNF0SFjhrKXLhQf3rX9Ej4OaA9vyqPSmwSo= Received: by www-7.mailo.com with http webmail; Mon, 16 May 2022 10:12:11 +0200 (CEST) X-EA-Auth: FFXhq6GJJPPLnln+YC9TSY9XrSuu0iPsN7luwEx0g91ka9K9a6mgnnMeDJo8mx8ZosxBBy8lgfXFNIXv8b8CmMvDdiI/6ZUo From: nil-admirari@mailo.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 May 2022 10:12:11 +0200 (CEST) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA21.01/r20220415 Message-ID: In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v2 1/2] avutil/wchar_filename, file_open: Support long file names on Windows 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: > +static inline int path_is_extended(const wchar_t *path) > +{ > + size_t len = wcslen(path); > + if (len >= 4 && path[0] == L'\\' && (path[1] == L'\\' || path[1] == L'?') && path[2] == L'?' && path[3] == L'\\') Length check is probably unnecessary: comparisons will reject '\0' and further comparisons won't run due to short-circuiting. > + // The length of unc_prefix is 6 plus 1 for terminating zeros > + temp_w = (wchar_t *)av_calloc(len + 6 + 1, sizeof(wchar_t)); Not really true. The length of unc_prefix is 8. 2 is subtracted because UNC path already has \\ at the beginning. > + if (len >= 260 || (*ppath_w)[len - 1] == L' ' || (*ppath_w)[len - 1] == L'.') { 1. Please change 260 to MAX_PATH. 2. GetFullPathName removes trailing spaces and dots, so the second part is always false. _______________________________________________ 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".