From patchwork Thu Feb 25 06:38:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25983 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 16BFB449E75 for ; Thu, 25 Feb 2021 08:49:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE73A68A32C; Thu, 25 Feb 2021 08:49:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 513E8689F8E for ; Thu, 25 Feb 2021 08:48:56 +0200 (EET) IronPort-SDR: 9PMOzID2omVGMhRnEsGRreHvOJ9ZoGv4XVvJOFypSbwRVAThKxD0RmId8iL8nAr3FkXc5A6Eg0 pc+tZGAakCUw== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968995" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968995" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:50 -0800 IronPort-SDR: ObTcwww2FSaAJN99KMSdaWkzMjpnDeD4Zeh7Axw9YQUYw8Js5uqgCgN4sYhQZbVJrGKnozhE9K 69WdmWCmCJbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113313" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:49 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:15 +0800 Message-Id: <20210225063816.8644-6-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 6/7] libavformat/smoothstreamingenc.c: fix build warning for [-Wformat-truncation=] X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Part of the build message: src/libavformat/smoothstreamingenc.c: In function ‘ism_flush’: src/libavformat/smoothstreamingenc.c:510:49: warning: ‘/temp’ directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~ src/libavformat/smoothstreamingenc.c:510:9: note: ‘snprintf’ output between 6 and 1029 bytes into a destination of size 1024 snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:538:53: warning: ‘/temp’ directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~ src/libavformat/smoothstreamingenc.c:538:13: note: ‘snprintf’ output between 6 and 1029 bytes into a destination of size 1024 snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:545:63: warning: ‘/FragmentInfo(’ directive output may be truncated writing 14 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); ^~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:545:60: note: using the range [0, 18446744073709551615] for directive argument snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); ^~~~~~~~~~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:545:9: note: ‘snprintf’ output 18 or more bytes (assuming 1041) into a destination of size 1024 snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Guo, Yejun --- libavformat/smoothstreamingenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index ba5cc27ca0..5a9a5dddf0 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -501,7 +501,7 @@ static int ism_flush(AVFormatContext *s, int final) for (i = 0; i < s->nb_streams; i++) { OutputStream *os = &c->streams[i]; - char filename[1024], target_filename[1024], header_filename[1024], curr_dirname[1024]; + char filename[2048], target_filename[2048], header_filename[2048], curr_dirname[1024]; int64_t size; int64_t start_ts, duration, moof_size; if (!os->packets_written)