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 9C31B4FB63 for ; Fri, 27 Jun 2025 23:04:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id A5FE668E0B6; Sat, 28 Jun 2025 02:04:36 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 7407968E09F for ; Sat, 28 Jun 2025 02:04:30 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BB7BE439E9 for ; Fri, 27 Jun 2025 23:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1751065469; 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=StgtLJqJqySsIldLxz1QXo46O9yjBEkTX7xjNuTY4/s=; b=McG9D5FXlWiJ05IzIXfi3HukxMvPddQPDXZEAqa42QzJQPVqSChmSRD4BVfUK3O6rcJcJ5 IhZukxVcVr/J4OQT+9WsG0mKwZOzyGqtLlhiJ8IK4AUq2hZxEcubGfk2tOtIvkwVyF4zHT LzJ6A+twhPFH8sITTfJ/d/OBhgTCtJmTxIWsIRxjSIK3m31aC7pS/xhwiwcP/Y0sog1rQU uoTvvYm/YwtvCZwcBeSD+G/Kk/yHp9YTIzNK2Dueu6kUR3rTBHAuiibUXhZuP45W//1+tK Udsm+FY9RtnirsiZb81JtQCX6WMil8C6L9OYP5b2Uze7zSdIUv5YBonSPNIx8w== Date: Sat, 28 Jun 2025 01:04:28 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250627230428.GL29660@pb2> References: <20250617141416.950239-1-502024330056@smail.nju.edu.cn> <20250617141416.950239-3-502024330056@smail.nju.edu.cn> <20250623115530.GD29660@pb2> <20250624210721.GV29660@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdegfeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/4] avfilter/asrc_sinc: fix leak in config_input() 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="===============2436096639962679704==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2436096639962679704== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PxUqVb63g0sdrL16" Content-Disposition: inline --PxUqVb63g0sdrL16 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 25, 2025 at 09:43:14AM +0800, ld y wrote: > Michael Niedermayer writes: >=20 > > doesnt the failure path here need the free too ? > > int ret =3D fir_to_phase(s, &h[longer], &n, &post_peak, s->phas= e); > > if (ret < 0) > > return ret; > > >=20 > I checked fir_to_phase() and found that the only place it allocates memory > in > h[longer] is vis > *h =3D av_realloc_f(); >=20 > If fir_to_phase() failed after this allocations, then *h must be NULL, > which implies that av_realloc_f() failed. In that case, we don't need to > av_free(h[longer]). However, I still need to double check other allocation > site > in case we need to free more memory. failure of av_tx_init() with your patch results in a leak: =3D=3D3653806=3D=3D 1,260 bytes in 1 blocks are definitely lost in loss rec= ord 6 of 14 =3D=3D3653806=3D=3D at 0x483E0F0: memalign (in /usr/lib/x86_64-linux-gnu= /valgrind/vgpreload_memcheck-amd64-linux.so) =3D=3D3653806=3D=3D by 0x483E212: posix_memalign (in /usr/lib/x86_64-lin= ux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) =3D=3D3653806=3D=3D by 0x148AE90: av_malloc (mem.c:107) =3D=3D3653806=3D=3D by 0x148B2A4: av_mallocz (mem.c:258) =3D=3D3653806=3D=3D by 0x148B31B: av_calloc (mem.c:269) =3D=3D3653806=3D=3D by 0x2AD864: make_lpf (asrc_sinc.c:101) =3D=3D3653806=3D=3D by 0x2AE052: lpf (asrc_sinc.c:183) =3D=3D3653806=3D=3D by 0x2AEFD4: config_output (asrc_sinc.c:344) =3D=3D3653806=3D=3D by 0x2DD0C6: ff_filter_config_links (avfilter.c:384) =3D=3D3653806=3D=3D by 0x2E0FBD: graph_config_links (avfiltergraph.c:255) =3D=3D3653806=3D=3D by 0x2E4DFA: avfilter_graph_config (avfiltergraph.c:= 1303) =3D=3D3653806=3D=3D by 0x297A39: lavfi_read_header (lavfi.c:282) =3D=3D3653806=3D=3D by 0x667DF2: avformat_open_input (demux.c:309) =3D=3D3653806=3D=3D by 0x2512DD: ifile_open (ffmpeg_demux.c:1773) =3D=3D3653806=3D=3D by 0x272B02: open_files (ffmpeg_opt.c:1366) =3D=3D3653806=3D=3D by 0x272D72: ffmpeg_parse_options (ffmpeg_opt.c:1415) =3D=3D3653806=3D=3D by 0x292489: main (ffmpeg.c:991) [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway --PxUqVb63g0sdrL16 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaF8jeQAKCRBhHseHBAsP qwNIAJ9GyZujtN7MUZ02aNfgHllvtGCDMwCfcBz2zlovdEQoAQTMhw5+3AmNGRQ= =L8lK -----END PGP SIGNATURE----- --PxUqVb63g0sdrL16-- --===============2436096639962679704== 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". --===============2436096639962679704==--