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 3750545F86 for ; Wed, 19 Nov 2025 11:56:40 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'6nwTBPlKocRbAFA5d0gK1UaGIhgLSJ4GbJ2yGd0o0r0=', expected b'/Qf/vUPIpw5Fy38rz1iepAX1iAUu7TLy9ZAsMf284RI=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1763553388; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=6nwTBPlKocRbAFA5d0gK1UaGIhgLSJ4GbJ2yGd0o0r0=; b=EzQKynJv94F+c9Q/o6cIH/OS75SroL9USqYDqG5jOB/plfG7G60ZXbl6DHfQ3Om8UGMKs 6iCbYYtDaRJpdgC+jUKZoeFalWP9Jcj7mPnYunkcX9nIvy+IP868mPG3ofjfoNpc1r0Y0Jk UeA1UOr51AeWvvKh4gKQLNTqkfnmB4aCvpuWDhzXIHIoMxC5TTH2coPgqikmiXAa34zvzPW 6xzlhgMu5VtITK7Lct/m0HhmqaDC5pcS3hXSZElkgTnM31hbTiMiLNXGtiYehoym5SimqWW huBLkhk1CNm8mi8kGjp0W7AqcQKkIznI4TCKQWd3LjTEPHmxDzpu7Ym7cpjw== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id B3C9668FF46; Wed, 19 Nov 2025 13:56:28 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1763553387; b=aThzij1tHAkef9M8gtbfuoJ+LC1AuI81u9zfEve1cCM4U30i/mZz8XQ5GrhTPQyyqb64O LJ0HmQzjklvxi8DsmJ9Mwe81pe+L9AihOQCkbMpz4NUSa982GwK7wFt/ksp29VwelCIoDqs WoV/zpMl+4U5dYIs5o8Ry7u/nq3LMV4PmggetY4WFndpKulPujECR/oRoteh9pO9VCjK8Bw v99MCe7v+P62O3dXEZJdHeGv0pVDZxRmgzccvonrrxp1MtOXOnOoNd8kBcpIMR7+Iib31hN dpWhVRd6Ihnyx8n2K2698pfwRWkkUt7fl1yPIgkRyljtbjKsjaN3TwxdTD0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1763553387; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=kScai8+kzOeCsUkz2FBXivCmYy9wd0iM2ziSBQCau9o=; b=KwhI+19dhXOt/ECpnQA2UOFZ7nDpeZ628qm22oZR7MwbDPNTt/XlMkiuLTDgWNufdYj8z 34UJK4ZKZlTzqaWuNeLXLitaoUnryISkyid4aFySO3mn/K+nMdOFdM6HRPr2tXTitUtT48T DlIY4p+29tWetohRad/RK+dxQPzdXhKSacpcyL77O8MlxiPRHT4BDqXg2nwoVo2cj3O9Im6 c/ThozoNjqT+nL58iZV3wwmdZMdWAVOAh5wrlvajhhR/6saDIYAp10hChK7gxVvQYcJZZSW RDhKRsMkGSJhCzdT5xbh8Sz5YwsJKbUiURDNmkUJaJ6DnlfGi0s6fG46m4lA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1763553378; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=/Qf/vUPIpw5Fy38rz1iepAX1iAUu7TLy9ZAsMf284RI=; b=Ya/t4LitgOWD7bfsQpe9Y48JERyqlTlirScyfMXUCLWM5tBgdnpThO5M4jNVKyQaOYaki Zr7Vr2l/nn3rrCxZgDIYhbCNCykrxWEKKAnO3QzD0oDJ8NDFKqJckvnxw5yQioVKPBIUslQ qxaYPgT3sj1x2AhQBenPvDZ/ML1w8X0HIsv27Y2wvP7p6zThMn/mP1ommOb7opb/eZCK9D1 tAqC0BvJPMOD6J+Lmi1hzQVZUjGzcjQKTNeXH7XLnZVOXO946ANZ+I+rZSVKgNfdNMmLClp DAXoVlTsZ8mDNuLHfm4UNQsKA94qkm0I4EnAEsU3bagZ59NSG3DEf9g5ielQ== Received: from 188d6d40ca7a (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id D876F68FEA7 for ; Wed, 19 Nov 2025 13:56:18 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Nov 2025 11:56:18 -0000 Message-ID: <176355337901.59.14729924145596149116@2cb04c0e5124> Message-ID-Hash: 2KMTY3RWC3VC6H5AWB232K6XVXRYO4H4 X-Message-ID-Hash: 2KMTY3RWC3VC6H5AWB232K6XVXRYO4H4 X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: fix memleak when sdp create failed (PR #20969) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jack Lau via ffmpeg-devel Cc: Jack Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20969 opened by Jack Lau (JackLau) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20969 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20969.patch Fix #20712 When print_sdp() fails during rtp streaming, sch_start() returns error code without calling wirte_trailer, causing a memory leak. Since mux->init() (rtp_write_header) already run before print_sdp(), so we should wirte_trailer() before exit program. The av_write_trailer() only runs when mux->header_written is ture so this change won't break other case. Signed-off-by: Jack Lau >>From 063e729243a76e71cb7ee9f13d1d723ea1f135cf Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Wed, 19 Nov 2025 19:35:37 +0800 Subject: [PATCH] fftools/ffmpeg: fix memleak when sdp create failed Fix #20712 When print_sdp() fails during rtp streaming, sch_start() returns error code without calling wirte_trailer, causing a memory leak. Since mux->init() (rtp_write_header) already run before print_sdp(), so we should wirte_trailer() before exit program. The av_write_trailer() only runs when mux->header_written is ture so this change won't break other case. Signed-off-by: Jack Lau --- fftools/ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 444d027c15..12707782f6 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -891,7 +891,7 @@ static int transcode(Scheduler *sch) ret = sch_start(sch); if (ret < 0) - return ret; + goto end; if (stdin_interaction) { av_log(NULL, AV_LOG_INFO, "Press [q] to stop, [?] for help\n"); @@ -915,7 +915,7 @@ static int transcode(Scheduler *sch) } ret = sch_stop(sch, &transcode_ts); - +end: /* write the trailer if needed */ for (int i = 0; i < nb_output_files; i++) { int err = of_write_trailer(output_files[i]); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org