From patchwork Fri May 17 19:37:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48964 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3086271pzb; Fri, 17 May 2024 12:45:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwc/wF9vFxlJzKlqQ4mOpxxRXa9nSI11O3slTqEAOgzfJ8OChAmkoRTjI0uBF2+nbsZWHJws6NE6/md95GPlt+QtVsbrKYeH/8IQ== X-Google-Smtp-Source: AGHT+IGTLUKZsV4RSiFLEukkmnTrrQ1Szy7lK39DgUxOMhVCaE+W9MkGM2LmFkMsOJ69J7YaOJVl X-Received: by 2002:a50:a699:0:b0:575:2a8b:609c with SMTP id 4fb4d7f45d1cf-5752a8b62c2mr125973a12.22.1715975104883; Fri, 17 May 2024 12:45:04 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5733c377f3esi10332501a12.619.2024.05.17.12.45.04; Fri, 17 May 2024 12:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=NHaSexRS; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E059F68D1BE; Fri, 17 May 2024 22:38:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2086.outbound.protection.outlook.com [40.92.90.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE08268CFB7 for ; Fri, 17 May 2024 22:37:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MIntixzL7RnoKxoED2imBrxYzOjXhKisJXYra3t7qG+G9THs24weDXSmaiVFpfmDkNX0O6tF5m9XISqfi6nsv87QrqjaeiwLwjmnUkNYOjvIIxfDdjcAmq3ev79pPHHgZZfomahjTYoi0wIpt/HEeMZxta2stmLyqxQBchnayzbuCq5i1X7KXenZ3sOa1HJ1jptSlReSE4Upg7CCoM3Xzgx9vCmzZvJ7FWZLmAbzEtLabUWnGYGZJ3iO2LVOL7ZVEUzi65oDqJUedn9aJ8yXYioxZAdn2dBaPfofpzOUDYjFQX1R4pXNpsxlRd9yQPtyITiaVWviZYohr2Um4+y+ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ruWMQGpigRdM4pcZpxm1AdHEuv91NUzqkdR4GsnlD9c=; b=NKLRjCmD012gNSxnrAeEfwvBfj44X0EtuU74ZKczDI4CVqSAXMXGB0ge7OpMGihvTHfbPwGE+h6he3EQVtBT1HVDTaR6vxC1s9pFqFwUZMEjxWFSTeHgJxlapxXz554LnmeoYn4XXDU2CzjrC2ZDynfN1Ftr+mr5Xo4RgECbIj8VTZMW5wy0IvVz3auITEhSWomo/PSFj02kNqEiLwgYNlx1M1eScMM+3PLQyy+UXYVPGINt0ED4Ts5muJtociieyt2zWjgJFCQCsJlS3NCKgta2+f/kY74SrpqpayFxOomLuOHyjOBRqxGtUkX/ozVjJ78vC5lww4ii6oVNtziBoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ruWMQGpigRdM4pcZpxm1AdHEuv91NUzqkdR4GsnlD9c=; b=NHaSexRSmWXnx8Hkq8ZrQvr5QaC5Ui2agmvU+TJCduQVeLxm/jJhILXjlEiwcceXfN68BKYXXxneWxOU50Gwwo110ajfn2UtRxY78z3ck+Q8PPCylwyvbY+wm0Wk0Xmr6KSGptM0pLPZCRuQEMZbOG2ftGk1JuK3jkES0mtS5E4HKEwXghoTwjnzKcg19f5sGht+1+md0HvpY9AC3A3HQsPghwtiEF62lZ2i0T9RSk7/9a7GVEuZYHFbqn9vUYsqVC1y5glqTZGWg63hgotIRDeaVUbubKs/L+gvsyWnwN48iG+6IzC9kVxDeeTBLP0Ek/OyufmH50LwBdeLbpCUgA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU0P250MB0531.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:34f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Fri, 17 May 2024 19:37:53 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::384d:40d4:ecb7:1c9%4]) with mapi id 15.20.7544.052; Fri, 17 May 2024 19:37:53 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 May 2024 21:37:46 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [wq/qUlwnfgsy+vwSTYLKxHjFdwy4Og3UaLsXLjF3Z/8=] X-ClientProxiedBy: ZR0P278CA0110.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::7) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240517193746.289390-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU0P250MB0531:EE_ X-MS-Office365-Filtering-Correlation-Id: ae183fcd-d47d-43c5-1199-08dc76a8d835 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: 1dLt7mij3k5hWkbDVo6GJLhiKLpd8QN1QtCTFO7yQomFZOWXD98tf+QGG2n73IgOxVHxgJZVWclVTnAqNrXK50gGtTsIT5FNhpGr7/2b4A14KGN8LwrIDgwKeM8GYCRgRZ893sZkHD56+MDG7azVTCTCOjPFNeRworBQW3gnNZAwF1BadKjleYBedY/oYqZGUImmPbiMlBITdC8YuHBstM5WAZdDVtC/S4qCAA6o9hbsoqtR8kFJIQsxkbXCJxYibeeeJnTQ3u6klCR1To1W0H+SCzp2WBnz5YDyxTSRaImInVczLPUbG6eRjSI3yRtBshQloMEKTG5VR/2F2xNMXRq1Nptp5TbxcABD0F9o3td2vxxZO6QgI654MeFzzEmX3B4Cak7sweGlS/PaDpr2JRyTNXrPFmretDBniCv85mop48hvB55/sz/0aMBP/y0UVadtot+olVTd2Qf7BHuxGu82jHIqADmcbeAqf7kBpsCuVa1q567s0AQX9qxLsDIgaoPgWh6mnjIl0r4nWPyz5sezuDUzOOE0xp0yR+e/kMwogsAuVy13EqPpwXcacsiZsGyzlKbPbJuCx+jnrpsNQEgme10T50BYwbvOK0UP9k4= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: droxKzmt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O19wU6lS9ipyWGGp1gGQuUbMnQAMD6PS2EbSwspriLTJN8MUH7oeTtmTjNkjWVhuKeSk3JnhH10czMa+mED1D9RkYrJk4GR+VwHmoVSxo2OOZsFaHYoVUTpN5ep/O41Z9ImM8TH7UjTtwfWtPk1LnTLM1ML7P4dA8d0DrmiTakx2QbZl+pFqYZtmRQeKPK7y1cBIIovU3cTNS4O2lzKWBOlwBNjSoMsw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae183fcd-d47d-43c5-1199-08dc76a8d835 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 19:37:53.5985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0P250MB0531 Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: Fix leak on error 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: PTH0Tsg2eBtx Do this by attaching the FilterGraph directly to more permanent storage from which it will be automatically freed. Fixes Coverity issue #1596533. Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 382d0f75b1..12cca684b4 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1198,10 +1198,10 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost, FilterGraphPriv *fgp; int ret; - ret = fg_create(&fg, graph_desc, sch); + ret = fg_create(&ost->fg_simple, graph_desc, sch); if (ret < 0) return ret; - ost->fg_simple = fg; + fg = ost->fg_simple; fgp = fgp_from_fg(fg); fgp->is_simple = 1;