From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 6013D4C577 for ; Sun, 3 Aug 2025 22:57:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id D0FEF68C44C; Mon, 4 Aug 2025 01:57:09 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 073F3687D4C for ; Mon, 4 Aug 2025 01:57:02 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id AE2BA41DE2 for ; Sun, 3 Aug 2025 22:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1754261821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VbUw6csNQicofDndXcyJmC0UCkMvQnHmmAYdnhoE6rE=; b=fGZKxJQfeoLRPFGRBvC9IQqKJsCFjI8peDiDBi4+5ROVg51E8ogMfwvG+aIHVRhGhCkUN7 4DFT72L9PN0URYvITQYfRxzbUz4RKP2q5GsSTQB1ycgDmW8OfZnG+iSUy9k2SQFeDJbkPy ybpz391WK30btU66ogTHZfB8avr2YHEZqtEgf6TIBacRKjvepkI2852ZixmDqCSmJSWF0s uRgjirf5ixur1rj8j7AlbSC6/06kDjtRyIJ+fVrs6iQsTapa0HsBv2zlsqL1U0HcIKj14o seb7QBJeN1o3eoBAU5m9FzvWqOnDQiFMd3O36ozn7TRSyKNRKnlCfioST2IcaA== Date: Mon, 4 Aug 2025 00:57:00 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250803225700.GK29660@pb2> References: <20250731021339.2955179-1-caifan0425@163.com> <20250731082135.3114297-1-caifan0425@163.com> MIME-Version: 1.0 In-Reply-To: <20250731082135.3114297-1-caifan0425@163.com> X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduuddtjedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieehrddujeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieehrddujeeipdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] =?utf-8?q?=5BPATCH_v2_1/1=5D_libavformat/img2enc?= =?utf-8?b?LmM6IHJtIHdhcm5pbmcg4oCYLnRtcOKAmSBkaXJlY3RpdmUgb3V0cHV0IG1h?= =?utf-8?q?y_be_truncated?= 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: multipart/mixed; boundary="===============3231281976155690679==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3231281976155690679== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FIVlj47tWxo/qj+O" Content-Disposition: inline --FIVlj47tWxo/qj+O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 31, 2025 at 04:21:35PM +0800, Cai Fan wrote: > Signed-off-by: Cai Fan > --- > libavformat/img2enc.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c > index 41638d92b8..9a5718a8da 100644 > --- a/libavformat/img2enc.c > +++ b/libavformat/img2enc.c > @@ -180,7 +180,12 @@ static int write_packet(AVFormatContext *s, AVPacket= *pkt) > } > for (i =3D 0; i < 4; i++) { > av_dict_copy(&options, img->protocol_opts, 0); > - snprintf(img->tmp[i], sizeof(img->tmp[i]), "%s.tmp", filename); > + int len =3D snprintf(img->tmp[i], sizeof(img->tmp[i]), "%s.tmp",= filename); > + if (len < 0 || len >=3D sizeof(img->tmp[i])) { > + av_log(s, AV_LOG_ERROR, "filename '%s' exceeds buffer size %= zu\n", filename, sizeof(img->tmp[i])); > + ret =3D AVERROR(EINVAL); > + goto fail; > + } is there a reason this doesnt use av_asprintf() ? that is allocate as needed thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle --FIVlj47tWxo/qj+O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaI/pMQAKCRBhHseHBAsP qwojAJ9kkHeR9avolMSwW50uSEIj9JRqoQCghysRUVGtNemqG47LVQkWwBjnqU4= =JRrk -----END PGP SIGNATURE----- --FIVlj47tWxo/qj+O-- --===============3231281976155690679== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3231281976155690679==--