From patchwork Sat Apr 27 23:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48309 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1204878pzb; Sat, 27 Apr 2024 16:54:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlk4pZIrCOEkdgPpCMju+rmLztFgkBMpurdVrVf8369aMR2/xOGGTDvnOiSFTsDFmU9ZXP/vOS5WSOWAtmkNTJeWist2JVSCXwMQ== X-Google-Smtp-Source: AGHT+IEk7aQyycPdqaK2xVY+Wd79468gPVnZodhpOjLqu5mhGgqhMzu9yZCBTrF8NJAVgB71zdZ1 X-Received: by 2002:a19:8c55:0:b0:51c:edd4:5236 with SMTP id i21-20020a198c55000000b0051cedd45236mr2286083lfj.55.1714262077168; Sat, 27 Apr 2024 16:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262077; cv=none; d=google.com; s=arc-20160816; b=AN8aCawGo0iGtjosMY3u5K2JmYMdT9FR+lRbpY22kJ1v+9skiXE8zWCVyRrVReixIe FjmlXxD9i+ZlIHZ0yifMgbpnetoJSrJsssCIL/G3fOnLk+wEiTb9l9xHmVuzfYkDQezj RRYS37+t69HZ7mEVknHsYKzXwkdQDbetW0Mg+KcUK1JCrkLKgxfnN2ny3vM/o12H2ybm bP0lyWhQeV3PpOsc5UDjBcohb1EApQZiaKY3/rQRkcgDC7ucsOof9cIH3JrA68TBwFuk 6QmTAqYEyKKDAWAoNMxPHTlx4tl/oeQfYU1LZnZSv4/Dd8DD8TPiTLVey8w0QOfkoFuk 3tWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=hU/pgAiXIkkdouNJr2WwYlQ2fwiqPrYZrsom6T0W1xQ=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=tb5nryBGhNeeYsrmVtynWnyXacf9AaEr/b/wBkATipgKcwTTCvR6DcmS7Z/4433TRl GnIYV3z10p/5sK3/2hwkGv+18E6K8SV+gbXtCPpNs2ipcAHHOa/aZ6vBfrZGO4ducHvR j3Q29R7Q0sl7uh2Nt52Z/gq1g1ambDPUuuwTYPL7qZ/gq3akDhRJzn0WgdcOgQKWnmdS 6uLW59hPUzEbtXns9QMYqccvfgSixMoAlhi4+8HYk3feMe5cjwz8LmuBEzXtHCiHL5ax PaEC9KIDOdB3YitpLdAIbXyt6QRZpy+atZ8uVemzPR3/ww8WE9xtHsDb0yOAOhz5W7G9 iCjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=Q7krBtxl; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hd17-20020a170907969100b00a571c511dbasi8196976ejc.445.2024.04.27.16.54.36; Sat, 27 Apr 2024 16:54:37 -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=@niedermayer.cc header.s=gm1 header.b=Q7krBtxl; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C29B268D2EA; Sun, 28 Apr 2024 02:54:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F19D368C9CC for ; Sun, 28 Apr 2024 02:54:25 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 22F7E20003 for ; Sat, 27 Apr 2024 23:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UKP08vNd9/FFnH7lCUk4Urxe1ly3sqkG+rzouGA/H8I=; b=Q7krBtxlrwpHetBxFkIbvwhsy+/m9hp/RXcBtTiWvHXReKs8jIa4tbQ8iv6rAOFMa79mmF F9wYeXjwST8388uO2gWjkeMsT4xAHVzourN7ty5D2mftdTBotO4aKhF+RySA/sWm2+o6fJ V9J1JEnrM0Ne42f5dECTdcNs3cvUK1/EUYmXzBget9Ylmmc7VDqPDiE0V0RXrJKfD95GZR YYxwtLLEnqnCQ9lAfhyBvi7MwP0loygJqW42pcfbnhkq4GS418OfLTaxRF+GG67Uac14Rs Bx2stM2bWRtI0J5DiFpvmf2P6RniGZ5BECmv/ZDSZxJReuXEfUTWYjs9Bvf05w== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:15 +0200 Message-ID: <20240427235424.3075968-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 01/10] fftools/ffmpeg_enc: simplify opaque_ref check 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Ar/KkFdKvAuW Found-while-revieweing: CID1520670 Dereference after null check Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 618ba193ff5..863d1a43edd 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -476,7 +476,7 @@ void enc_stats_write(OutputStream *ost, EncStats *es, const FrameData *fd; - if ((frame && frame->opaque_ref) || (pkt && pkt->opaque_ref)) { + if (frame ? frame->opaque_ref : pkt->opaque_ref) { fd = (const FrameData*)(frame ? frame->opaque_ref->data : pkt->opaque_ref->data); tbi = fd->dec.tb; ptsi = fd->dec.pts; From patchwork Sat Apr 27 23:54:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48310 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1204912pzb; Sat, 27 Apr 2024 16:54:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUb4jU3+HWqbNEcC7UY9cw0ujLqmf2t5naZAcfqPW60phl21yCSMpU34KhsUnUy9Lk7MW0f1Jjcoy9fjp3tNj9aaN7Y2gdbDanulA== X-Google-Smtp-Source: AGHT+IFa5vW4lvVOpxBFGTR0cUwQtZwe2G/ByPNC4H5BS3uZ0C9nxRJhuwKS5nf/QhP+H0o/0Iyh X-Received: by 2002:a17:906:1290:b0:a55:acd8:996c with SMTP id k16-20020a170906129000b00a55acd8996cmr3811060ejb.29.1714262088123; Sat, 27 Apr 2024 16:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262088; cv=none; d=google.com; s=arc-20160816; b=mWkV2NUTol9tX1wIml7ZY1XxPy3bjHu6ftJ2qIh15BLT4Zl2E1RL0QBK4NCVELz1uK eUunZ2NR54AWLB5X/k05qbNMYDUDHvjU+SSFN3tBEfrzvVKiKx4BXL33GX0Pzfmys/m6 Gnsb780tMUXRVjrxBCALlolbf8j86CV4PouzzCnDCNEjWBaigm/siy7KI/SYohZ8bz6W c/gR//8jNjSYSvlVadw9K10BVJdC1A/x1kK9p1/zpy4T6xqf6MXNUW/SNlRRR661Zpgw 5ZKcllIKN7Fhoe5EXq/vEh+yYWa9Z4qE3FSLgzOzwvniHmllTV9yF5NmT6SWFQt0lUJp hP+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=nMJg6xW2YTEw9TISuBJGqp7gvhkkJNRbBQQiHZYOfaM=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=CjW1D3UX/dLUXy5JAFLkC1U2BR681mCH/WmUxuncchnaQ359NiOe0o9yZ7lcMJzt2q vdTz/h/xnOyTmn5A+kqdC5srWVm58NrFMRw0ieNyt12pIVjXu2BC/pw2UKYV93/aewN7 RKqhgsiZ2KvciWbhIYZQKfyFLltEXjPPx/w2mFog7nvLXDBuOJyNMhkgqG4h2ks9eYVU r5fVJHzfkfME9Gx52ix3fZMVwd5nZOeboKh4r7nAzHxxjqRZkHYrNMI0IlDaw/3r++Wx qmuiYPky0rSYYFRQEqYoahcyxHbkWFURdgKdlqeY7tVc+DFdP7wr+In9JPmLzA3s0Sws bK2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=P7zzRvnr; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d19-20020a170906041300b00a559b8ad49esi10227564eja.1044.2024.04.27.16.54.47; Sat, 27 Apr 2024 16:54:48 -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=@niedermayer.cc header.s=gm1 header.b=P7zzRvnr; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E57CB68D33D; Sun, 28 Apr 2024 02:54:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B566368C9CC for ; Sun, 28 Apr 2024 02:54:26 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1DF2940005 for ; Sat, 27 Apr 2024 23:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cgXcQjBixzwGchFmz0XDDb3jYEOpmwW2vdXBNGlV4qE=; b=P7zzRvnrC9axcjrflmjflLdhd11pOykoH1EE4qOVA71r1R5916x4Whr9TJ2Ae0kF/WRKZb Cn3S+TgHb4LVeBY5YKgY487BwCX+IMTN7yYJST5KECRIrC3kBZMkAqCghANWa7BZGqdREX StEO/+Auk9apGuCIN6pS1ZQpOErUTpTg5CaJyIpF5Sjl8qoTA9QSiNQftZl+Gs2nejuCAO 2yyoc7n42v4Sb0kcou5LmXfNC8jZX+6B2uew7ex1etsxnBeBfjbKtGKhNUVWsD7hXax3cp ho4bKBTJ3BxEdN8cG6dSfHXtpcmlGgcmms5RZM5PxpXbXqeOhSH2HuK85IV6/Q== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:16 +0200 Message-ID: <20240427235424.3075968-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 02/10] fftools/ffmpeg_enc: Initialize fd 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HN29SPEk+ZQr Fixes: CID1520677 Uninitialized pointer read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 863d1a43edd..0b3f3f101a2 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -474,7 +474,7 @@ void enc_stats_write(OutputStream *ost, EncStats *es, AVRational tbi = (AVRational){ 0, 1}; int64_t ptsi = INT64_MAX; - const FrameData *fd; + const FrameData *fd = NULL; if (frame ? frame->opaque_ref : pkt->opaque_ref) { fd = (const FrameData*)(frame ? frame->opaque_ref->data : pkt->opaque_ref->data); From patchwork Sat Apr 27 23:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48311 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1204946pzb; Sat, 27 Apr 2024 16:54:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVY0lPn0JACJav26z+Xjm3JuT6cOUrhKIKy/g3q/3LcMfcXINEZmtRlLCwfYhaOBt9y6BexUCR1ZvxRGdhJ8FItiEUS5/ncdFk6Yg== X-Google-Smtp-Source: AGHT+IG07IwzI/2aFwARYm+eqS10//JYzvSN0ei7rAUy24OH/jvv1Uhr5nPjQbb2u8bgyn11LFFP X-Received: by 2002:aa7:c952:0:b0:572:512a:ecb6 with SMTP id h18-20020aa7c952000000b00572512aecb6mr3584849edt.4.1714262097115; Sat, 27 Apr 2024 16:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262097; cv=none; d=google.com; s=arc-20160816; b=yP/Jx/o1MKeS7NZUqxd4qfhc+YqsGBx4xiF0OXPNZEdIRqU6k1myoplIFpuZ+44jKa zsPt2R/w9qmzt+IjJXsVe9jfH3mC8eCg4EoUpBKOSq7YoL5IajX/288K2C4sKHMqHWPI 2tfDYZTveWsmzrpT58t1as/z60Y/ylC4rOoUp1czhFaORZCh8yw/1RQUNjTWhYdRhRO2 /yZhpzhEBLmUD0nuk7AO/CgnOt4LqZ1JfX8o6FchbHMg1DuvlFOSGUpHKc+L8p2cWPln iWnvFh4Sp2mad47QomUkHe9eP/W0kzXWFdICdUxGOcKrpm5icLnF6vYgd6A0hMSjcTw+ bidA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=nA3HrK1fq3Br8Nt4XTNxTR4SNKnvOCfii6G+ynqh72U=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=drjhVARb2lxjO9V/0sfwprrBRAelbZWy2L2vAIPSIkzOmz6k2ySfmFPcx5DD2yJQIW F/gSQgeDMUp/J1wXgdocxuugUT9LaSWLwhxgauROB4bG6UAYrkFRSG3I93h9PGPaJ6kc d7Hab6VGTPzCOjERtI27pMTlxt3Yc7s4Iz/k4jgwcwYi/uc+5oH3OWR8Crx0Fa2e7e7I Vn7WKNqfL8fI1UWO1J6gGQfvhlID6onm2RD78MMX2DElN88uTadSBGloCGuFmMvbp+Ug Btn6wKf+xQn7qu+RpEZtqqRs0jzb2LFGrV5/xzNTaoQ+R8reblR1W7YWkEJd0xjFkAq+ R6yg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=cEC0qUhe; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e20-20020a50a694000000b00572726facecsi740741edc.352.2024.04.27.16.54.56; Sat, 27 Apr 2024 16:54:57 -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=@niedermayer.cc header.s=gm1 header.b=cEC0qUhe; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EE8A68D332; Sun, 28 Apr 2024 02:54:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6EE0E68D2EA for ; Sun, 28 Apr 2024 02:54:27 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C9ECC20007 for ; Sat, 27 Apr 2024 23:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fSJbyicHn3P3WO5ffYBRa6YwromrSeNk1XYy1LP/xMg=; b=cEC0qUheIFd8FJ3krUDOApkCSX6qiPs1eHinSJpNF1vacJfBB0nAyBW3Q4VacO2VbuGBNf bembWj7BYRdJIzk5bL2BGpvJ8fZygEzZYXin7M+7911cbNs7ibXMyhCVQHE9Y5HTbHfncE fQ3l1A6/KFAA/Hxlgusd2L7q73w6XcQnDvJ1RY5U/aIJMmepP3+stdShWeJQAXO3ePhzO+ Kuf/cwbcXJUD8su09uFqbG8zbz+91FagtriB44yh75UcygfyhxQuB++BN6YY9+xJnKlpLe 3hGqqSDEzc3tseU0w8jH95XZuwom4bCq2ww/1tPW15KULkvFU2hyeJF4yEWzTQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:17 +0200 Message-ID: <20240427235424.3075968-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 03/10] fftools/ffmpeg_enc: Initialize Decoder 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Xy/7cT46NxOt Fixes: CID1591439 Uninitialized pointer read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 0b3f3f101a2..928114c20ff 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -168,7 +168,7 @@ int enc_open(void *opaque, const AVFrame *frame) InputStream *ist = ost->ist; Encoder *e = ost->enc; AVCodecContext *enc_ctx = ost->enc_ctx; - Decoder *dec; + Decoder *dec = NULL; const AVCodec *enc = enc_ctx->codec; OutputFile *of = ost->file; FrameData *fd; From patchwork Sat Apr 27 23:54:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48312 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1204972pzb; Sat, 27 Apr 2024 16:55:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUSNrt8U/j4JHPQL3CH+eXCYmWGq9mwP1AzjQIvUEkTnDJX6xRT+gx3ajITufjfj63lhb4XRtn0KXK99Ja6UGtLhz0/vHehRzJKuw== X-Google-Smtp-Source: AGHT+IHuAxXwJ+ErUPFIRD0dl2dOgOgRKbMY/FaYH6K//vdYk7oWoyQcicUnPIfHi/kg+v8JzOAq X-Received: by 2002:a2e:98d2:0:b0:2df:65b9:3a6f with SMTP id s18-20020a2e98d2000000b002df65b93a6fmr3186453ljj.2.1714262105566; Sat, 27 Apr 2024 16:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262105; cv=none; d=google.com; s=arc-20160816; b=XrDxk07FrFk/OmtrwuBo+2dwUamfaEmJOPS1dDr8ItTyP19+Y/1Fx6eyMiyxDp/zwY WKN9gDv1X55ymU9UA7NsxIWP5kJ5HbHhDWtg7xzR2fC2dzhqGjorFQrNETIL6+167jfk 0i3DTHQ1EYTgpbLVP8aOXo117W7bdD7chUkhhOQRdrxCTna0kpDI/qYrDlUrD8AwHjgi 0f4pnsptnpUeyMa7c/K3y2r1s1ZRPIh9dIwZiTx6/ZquWdruteq8gKhxRACeJ7pzH2mi dk2rxbo3RrD85T4VqZRa0mk+kmfcVQxkUIQ9dlcuko6Y0kNsANHQPbRyFynxhPp3a/eQ V03w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=cAGvF0AG/T1YCD6FOcnfQspn1e82VdShjmkwbzxMXik=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=jC04qRo5r27dEB0iEDNhwOtGPvvz6vqiQQjW2qtMHmCM1aQMuaElOh9ZO47GAFrL3P /XXB/dn3hrrBajoz6xKY0hz3/FtcRSxxHfCm6LDDk8Du7olalHJSHN7qNhLOV+Btsaa1 Z5FC0Mfi0uafIZUgzOE2I/Qy13nZPYvgid681ct2Ani/O2jGceosAMPDOVW0vR6ryZx9 njiVgI3P+rCQ/bh29b5SDKcTnekihWH3WikENLeleDVCaQsI1uBY3qm9nZrKle/WKgxQ Q/6QcwwoM2MiEsP2WKytSrH2sNDoisAHuJuzdkSiMccGU4QVlqFg6L6on6YgTk5iBoyL LxKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=CMfssqYo; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i1-20020a0564020f0100b0057267a56917si1578812eda.120.2024.04.27.16.55.05; Sat, 27 Apr 2024 16:55:05 -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=@niedermayer.cc header.s=gm1 header.b=CMfssqYo; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEAA968D2F9; Sun, 28 Apr 2024 02:54:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AFDE368D2D0 for ; Sun, 28 Apr 2024 02:54:28 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E168A240002 for ; Sat, 27 Apr 2024 23:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nKt+ffRIEKYjHT9PMiSnMnF3mBq05/JsLwFxMrhvLLg=; b=CMfssqYoYNJn9rifKIRj8vJvdFWTx+X8WoXJpJk0KzTa1AHSDNisbkrK2afxa1V8zCVR00 o1R2TU3PGsC67rPSbzCAzxrHTgZeZyWH2nU/EWXW2RE5MCB3fxoGlIQYMVoYHiUEKNag06 CEWNQY008iewbrsVqYMGmS4jYOcUKhZscjaHemrUzqBGkUdPSCb67PSTM2q7QP7lHe8FBg W/bF+iZ9LznrZx3vPu4ZUYwTziWA0khgjr+3TIGKXF5CDNVDgGrSKYJgqSV7nLN5M/rIst H804/xwuPqfO+cVAahjy2TfEttfRy83efHQMCW3/d4eiQmq9KzEKjSXYX8l1gw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:18 +0200 Message-ID: <20240427235424.3075968-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 04/10] fftools/ffmpeg_mux: Remove unneeded initialization 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 5yXi+Se4IM5X Not sure this change makes sense, the code is more robust with ret set Fixes: CID1559178 Unused value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg_mux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index a1583edd618..4306067eca2 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -290,7 +290,7 @@ static int mux_packet_filter(Muxer *mux, MuxThreadContext *mt, { MuxStream *ms = ms_from_ost(ost); const char *err_msg; - int ret = 0; + int ret; if (pkt && !ost->enc) { ret = of_streamcopy(&mux->of, ost, pkt); @@ -299,7 +299,6 @@ static int mux_packet_filter(Muxer *mux, MuxThreadContext *mt, else if (ret == AVERROR_EOF) { av_packet_unref(pkt); pkt = NULL; - ret = 0; *stream_eof = 1; } else if (ret < 0) goto fail; From patchwork Sat Apr 27 23:54:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48313 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1205041pzb; Sat, 27 Apr 2024 16:55:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVPoVEMzHimTHE2WA3CKmytcwceS8hZ7i/2UWSKO7goerv4y2KHRCB5uuZx8S6itzInwnY6Kr6tYSeKm9a2SP0DOpKcR9OAXO6iFA== X-Google-Smtp-Source: AGHT+IG6mfx5xvQT1443E5EH0ZufA8Vlsx4TgKo2vltxS9B3dXo/gMuzsw8LqVS4DqEUs9acFuph X-Received: by 2002:a17:906:3157:b0:a52:3984:148f with SMTP id e23-20020a170906315700b00a523984148fmr5063178eje.36.1714262114871; Sat, 27 Apr 2024 16:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262114; cv=none; d=google.com; s=arc-20160816; b=hqdXT2lp5DU/88JkCWDxij72NxV8yYX9ay1QjFMdWEvaTgG7mybdDP4RKUmGNhTpXT FX2QqErdRgCDesg1qBRUfBww/0+vAjUaA1oMyOWEZ5eRdOYEYXs829/l56h8EB6TPd1y X0AVp/t26gcXnpY8yZB1084riutrjHrPSLXYx/ir71a7tbViTPEMc4NR+G9cxzZP9/e2 tI3whAY6in53+EU0oiv5I8POrYyW+qRaUMo+cIWjhv/GZ4nrSsG+JEi82YRfQqSPFLfA 5KOUg+OJgFM9zEAzVNp1oRUYuzv0rn1GRZuqNyr7zrqmEFEEU/PTfGYqunP0XJ+jngZc TU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=AKJHhv3GOpXbeWZ4j/RpiTRlm3C05xJq3FjgKFyjk40=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=aocyOq4gXu8N937ULr6uLwnCQ8Y0QCIfFpDoGybeAJSay1BPw8DQOLzG/0fQmvkfC4 hfcD4YmtAyU1zE/tVf81OqRccR27f09/nbVpPZIJsahxHJzMOEx0axHCAF64GUxXyuND XipWE7p1EJNYneS9mj5Z/VwByDexWsG1d7AsHMgnvHyLqq1E2YrffFLD0lGw2/zvWP15 6IJlfoILtir4kuG3QAews481MIsvJymLTBKAg1AzT3CbklEcc/bxORiDCTK762XAIaF9 Feyho4y7OEl5HaSuPlC5gs7sf8tXA3eqAvpQ60a9XQj+WSiLVWby1MY97QtzR2N3wQQ5 XG4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=V1KzLn8Q; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e6-20020a170906c00600b00a4e85cde33fsi13092222ejz.886.2024.04.27.16.55.14; Sat, 27 Apr 2024 16:55:14 -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=@niedermayer.cc header.s=gm1 header.b=V1KzLn8Q; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E252668D3EC; Sun, 28 Apr 2024 02:54:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89ECD68D33D for ; Sun, 28 Apr 2024 02:54:29 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EA15520008 for ; Sat, 27 Apr 2024 23:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oqn2l9IwGp+njdTnm+ksBzh4PsqnCl3k9fuwl5Y4bAM=; b=V1KzLn8QQa6rjTtWqPK/6Mt0P5PzG+MPx1biVw/9W7kiVAZqC5nJ7MTWgoC9IRP/JoTW7j AOH6qAZzeVR+9piGix2MgQSVQPJZzjniC2piNvTYHDpVl3WOuNIyXJuguD5ob0Hwl+lDQO yi+FsWzjnkmSwCblRm8uFK2WbI7yAOZ1CYxvKmF7gt7K2AR4AuITDyb3Gm4obrQ+UeMGpg bxIvO21T4n7UJzdT+yimik4O0jbVvQkHEAY1yjZGWXJdfnFPkCZMyyQbO9DeBkLMr+BKhk p6wbFAtR2LQFYBswxl6AZucY/PmO7Pkgyb3ULt+vBJsvzJY9hC+D9gHd9jN6gg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:19 +0200 Message-ID: <20240427235424.3075968-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 05/10] fftools/ffmpeg_mux_init: Free pts 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ROocz+FrQO/P Fixes: CID1538863 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg_mux_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 8797265145c..b1cb6cf7bd7 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -3025,7 +3025,7 @@ static int parse_forced_key_frames(void *log, KeyframeForceCtx *kf, if (nb_ch > INT_MAX - size || !(pts = av_realloc_f(pts, size += nb_ch - 1, sizeof(*pts)))) - return AVERROR(ENOMEM); + goto fail; if (p[8]) { ret = av_parse_time(&t, p + 8, 1); From patchwork Sat Apr 27 23:54:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48314 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1205076pzb; Sat, 27 Apr 2024 16:55:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWx28XdbSaZ/QnNe0mYvXeQGo589W3ttX/lObLYkJs0Ogsx7XZQyWPzEriVdlq0/T6h07MYhuQamfBibOnfm5+tlIndeXrx33Oybw== X-Google-Smtp-Source: AGHT+IEgnL/E/Lpc4zBDYIzG8qOB+EcAs/h7UEFGrgQMU9QbYhylXozeuMX69aiUSpzwsl2kANHD X-Received: by 2002:a05:6402:320a:b0:572:5f24:153a with SMTP id g10-20020a056402320a00b005725f24153amr3257808eda.3.1714262123573; Sat, 27 Apr 2024 16:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262123; cv=none; d=google.com; s=arc-20160816; b=KIBeaB8+yq3WmlMlsMe7+0xJLVTt4+i2LWrtJ7+4x7Tss05xUiXnqi2Tu+fzuzybCL l7agCg7HVTW6666OwSjo5k/r7pv/d55cRr9gdfHDAOQjdv1HIMpVfSCBu8t6fAHhBFBr 92biNpPTnigrN4cy/H6vv7SETMsdxWVg+ZI7mez+R7Tu+uUD3VMhxgDA5a+HdV6dUmS6 S2SYDUVUCbXUtRJbEYAFoB2Wlk2vEr+D3lc1+JyxgURdcGmhhacLiQWSm4ZU3U40HUJA g9sgRKPJldOMLeJvL84x1zHUg30xyvsviDjtAwQYcIDA9zrPQyZTbD30h4ZttYhoi/HS kFvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=S5aM9hNmpfIKbI/DpcZviz345lel5/QjOafmHEKe4LA=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=PcK9MNwv7zcqf/5370BSQrdGC+GYb8TpgB0rZyNmJJ05/tAyK5LgIJTETdQ9YYNPcH idXpS+uhWZmqEP3qABVCVNU5t7qp4AK7QhppQErEXOA5nyGMrdeE1LlowTAuHpLpYmgu XPHA84OWOCFVVLNpkBwdiTVZ1e8Sc5J5cwJ4BCXpdZUvNeTuNVhCCR+EyFVA81ahKG0P d8fKcfAvbgLssl2JXOCyNIizNGftkxX595cZRsgjqiVSFDg2dmaQpgEbMpR/B7c9SXWn emmDN3LUOcRkPmjdlfBEjjM7u2YsyxeU37+fFW2ejWINYoEF8/kf896ZwPotp8Pg84sb WrXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=ZZLpoMb7; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a11-20020a05640213cb00b005726b7f5f8bsi1401039edx.557.2024.04.27.16.55.23; Sat, 27 Apr 2024 16:55:23 -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=@niedermayer.cc header.s=gm1 header.b=ZZLpoMb7; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EC6EA68D380; Sun, 28 Apr 2024 02:54:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 97A6868D373 for ; Sun, 28 Apr 2024 02:54:30 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E88A0FF802 for ; Sat, 27 Apr 2024 23:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EW4XKhXkxiOyWZHZm9FhAaJlG4N7cXAQKui9/cEqY4M=; b=ZZLpoMb7SwRJsbKV/KA7CTyLLksr2CWUTPBM4hl87FHThBFUg471altsJnlReABGncrO13 We9sCCuBzAvM8aVP7+P3nKOxwcxnKPBheaKPrNROmB77MSwdWs+wmyM34eAxXBQsolEvgu SqTBEbevoc+paIWhNEidvr5Cq8gwgzqUaaky8sYTyNcaxlsyZGGKp1i7Bidh5Il8Sw0SUk oyLbsoLKLGjsmKW3jaljNA1tQYGpT1dTC8vbw06nn1086i9Qs6T1LTg4BVCbwGpIsVshN1 mjRdjTLaQ2c+GH45zJTRgh0GCibU4EyGmLwRlORY/ckm+SZGpmi5biTsid+AJg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:20 +0200 Message-ID: <20240427235424.3075968-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 06/10] fftools/ffmpeg_mux_init: Cleanup on error return in set_dispositions() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9SRTRRq3kVFZ Fixes: CID1539099 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg.h | 9 +++++++-- fftools/ffmpeg_mux_init.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 885a7c0c102..7fd6c57d50f 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -868,7 +868,7 @@ void update_benchmark(const char *fmt, ...); namestr, st->index, o->optname.opt_canon->name, spec[0] ? ":" : "", spec, so->u.type);\ } -#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ +#define MATCH_PER_STREAM_OPT_CLEAN(name, type, outvar, fmtctx, st, clean)\ {\ int _ret, _matches = 0, _match_idx;\ for (int _i = 0; _i < o->name.nb_opt; _i++) {\ @@ -878,12 +878,17 @@ void update_benchmark(const char *fmt, ...); _match_idx = _i;\ _matches++;\ } else if (_ret < 0)\ - return _ret;\ + clean;\ }\ if (_matches > 1 && o->name.opt_canon)\ WARN_MULTIPLE_OPT_USAGE(name, type, _match_idx, st);\ } +#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ +{\ + MATCH_PER_STREAM_OPT_CLEAN(name, type, outvar, fmtctx, st, return _ret)\ +} + const char *opt_match_per_type_str(const SpecifierOptList *sol, char mediatype); diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index b1cb6cf7bd7..1262630b24e 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -2933,7 +2933,7 @@ static int set_dispositions(Muxer *mux, const OptionsContext *o) nb_streams[ost->type + 1]++; - MATCH_PER_STREAM_OPT(disposition, str, dispositions[i], ctx, ost->st); + MATCH_PER_STREAM_OPT_CLEAN(disposition, str, dispositions[i], ctx, ost->st, goto finish); have_manual |= !!dispositions[i]; From patchwork Sat Apr 27 23:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48315 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1205118pzb; Sat, 27 Apr 2024 16:55:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUfR9mISys+5zl2wB+0kfdoyvBBi3nFiCcfHOSi6ueL9ei9rCdq9S5hhdct1VJzGHipmJbrBHolIUjbi0Bvqce+2HUW/CajU9QwXg== X-Google-Smtp-Source: AGHT+IFt8MOGgeqp3M5vOWmWedP+2MHg8iLc9ZxTweg/J1Xo6ltEio+mnaOAmT1yFUXWYj0pKK12 X-Received: by 2002:a17:907:7676:b0:a51:d204:d69e with SMTP id kk22-20020a170907767600b00a51d204d69emr2613983ejc.7.1714262132438; Sat, 27 Apr 2024 16:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262132; cv=none; d=google.com; s=arc-20160816; b=WTEz0PcgJl8csGlZi+TWkp7kUu9QEePY8XMAGg9ewOlz8JN+YTkmpBjan++YI3Xck9 7gxVAdoaZvYI4aWEXKp29zGK1N+bNIUVGr906B0VEjbOLbeT2jJaEy3KECCp8omJziTZ NDunhl61ntXEwFsDxnykw2DS41/YUdoA5VA/7B4AJQAJa8HiVW4ZQsxcowYx2vMR20An FIbeAGy2P8ouoZ30ELsi7W62xel52r4MG7J5Gv+m1q/1uakX+THO6O/VTwowxK5/MYQA 9eGTU+lfHrCdvpswaHHdPMJCgcm0FdIkGYv80XtV4Cku9M/3MBtPnpXxgUr4yS/QSkou kbqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=+1iNjRAygQG7sj/57DSX4h5qAwwvvErph44Wcd8ZeCE=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=KrFWPbwhnUy2fOXO21eEUawluOg4ic47aAQzgJuAmptJXo+ofvS7ZP4HQF5J7NFqAo 1wOfWs04pM0Acygssf74ZORAWBZC+h/fn22OOYF3Um42XRB49ZFmkR8PFrBbqAQ6KqTt UcVHxYIokOCa96d7nFFt8NL0CeFWh27QV5mGjKxBpnfycz58OEg20zqmaIheTF03dZpv HFymESp8Kd23tgfdt+Fz4mVKuSlJo6unHLn17r5EmoTEHGa/ULNNZVkWI+mo9ipCgveo gE4w0rJGPSj2EgIeAsRQSK5x0LTrR46QhBsLdJn0+AIgRVicXWszW2Nt18+cKMJ70wDC /B8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=A35On0He; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bw7-20020a170907928700b00a46b46a4319si13539963ejc.717.2024.04.27.16.55.31; Sat, 27 Apr 2024 16:55:32 -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=@niedermayer.cc header.s=gm1 header.b=A35On0He; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47EEC68D3FC; Sun, 28 Apr 2024 02:54:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8E0CE68D37D for ; Sun, 28 Apr 2024 02:54:31 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id ED6A3E0002 for ; Sat, 27 Apr 2024 23:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/UWgHSGmthqELUReGD+aH+p0V0rpO0G0wRuuhX85xd0=; b=A35On0HeK/Ubv3a2gWeOpW5U+bRmaMSwmZ/4hgXD9ZUeaxpEIZud1QrVFNw4nZJ8D9RJ9x xVhQ5z0J9uJ2DOCJf8OCJijkGmp3hlqdl38uP7zznW43+wfrrxKypkvxPIwnY0h7ZHw1c6 BYgFWo3aVqHvN+w9un/ZNpXZFsx21z8jU3sGITB+54DCzAmcR2oRvdlbIFP3mfrUcr3coS Cl2yDbKk5Z2Y0+bJd5zx3G/tRSddozedjwF/61FV4+b/OQWiV2EYXG8Ohez74FnJf5Zh7T mUuCbiSYD0T9MfA1WOcLEElk175LDZJpE+110ZNb/6y9XEW9P9NaayeqxZQMYQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:21 +0200 Message-ID: <20240427235424.3075968-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 07/10] fftools/cmdutils: Add protective () to FLAGS 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 6WlL+aAYM9Ps issue found while reviewing CID1452612 Free of array-typed value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/cmdutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index a8f5c6d89b4..d28f5f3a8bd 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -578,7 +578,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit, return o; } -#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0 +#define FLAGS ((o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0) int opt_default(void *optctx, const char *opt, const char *arg) { const AVOption *o; From patchwork Sat Apr 27 23:54:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48318 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1207813pzb; Sat, 27 Apr 2024 17:04:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUTJ+CxD9xBHQYagbNOnOWLZHrfE4zYjkEUfQgdzNSM43agqDMjnHI5c2TseaGWGJJ3m3+PLyHgNe+m3yegJjSo1gYkiB5zrwxY4Q== X-Google-Smtp-Source: AGHT+IEGX9XyCqfKaZXT77V8tiCBJ41sfsp0dv8y0os7BKpEr4HHESD5jY/m1iYSetgLJDdO5Gek X-Received: by 2002:a05:6512:3b20:b0:518:dfae:2691 with SMTP id f32-20020a0565123b2000b00518dfae2691mr4817300lfv.11.1714262667733; Sat, 27 Apr 2024 17:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262667; cv=none; d=google.com; s=arc-20160816; b=XO5OyLNKOyPzlTxi0R1xM7SyaWgq5OGu3bmAcsLnlYGOTDOI0vdkD3cU1mCkSPWr8a ygLyS/ACfkFpqdeA/2IXOz+ZTIuuk1knxWa+pFuEuwjKWkPAQzpmbEsFOzdxl0l2tb3c x1JHpyPmnZRdhuB5zV+zMauJdmfXVLQPdS5J+u6B6M40604/dTGxytViT75AzFhKpuly +h5IVuNiTE3cGt1wJUWKBIjgLjJxIcHItgnoegUL4jOzq8BKkWEUkm2s22uMAdXa1i4w nruL5f4QNBhJwrvwZlcRJBC8RUfXbpztbdowoqOmGLkIrWqOw+/DcEb+xT56Wi416Pdo ORww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=gOeGuNsTuTPfM+nE4nfDSEDRA9Mt9gyMAwTbjlCjAgk=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=aypHYfMsCMzjnRAhzVEpO3zX/0t6wIZCuNt2kmRzhJ4oxaij5Iyv0llRNQWYRM0Tac CWcHD6hntdjpo7fS40dhrsAZc02UwlrB9snGhRR/vRDs1mxgeolSCN3IIFkWvaqdv5FY 9iwqYWDJoqb4XyeiUYVkjX7Me1aQg2wUcT4Ob2ADCTMJ1DThEYpbOnBN36418iX+A+Zw sBZfwbJ2SIvJNmZQczZzw+++4lz3RnfMZ4h2PSUt9yCd4f+L6E52tqnTvPhwX3KKZDyH rpB6ToT6hWfBecfMPpD4pF6775eMoKT/gBFWetLLWZZdS9sp4d7DgfcwdRinjCaVl8X8 AFLg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=GNzCq9lA; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gh1-20020a170906e08100b00a51d2f1e65csi12899177ejb.252.2024.04.27.17.04.27; Sat, 27 Apr 2024 17:04:27 -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=@niedermayer.cc header.s=gm1 header.b=GNzCq9lA; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5D8FB68D40A; Sun, 28 Apr 2024 02:54:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B35268D391 for ; Sun, 28 Apr 2024 02:54:32 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A02BCFF803 for ; Sat, 27 Apr 2024 23:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5gCn2r9klat3Wedr+W2leZZBJaBlrfBJFbZ+2FQJiJw=; b=GNzCq9lA26iAIoaVaZiOQMmuX4Lp7dwsxFgnO9wEQthA1MHU3LbaOKQXPCL9dUxo/Pi48T s3dAhaDE59aZmVF2myjmpQSw5u/Y2E/AkHQziSNe2XBmSqSFmNyiM3kDXKE6h5e0Umr9ZR gKEyLGBFZFbocGTFTyC9DDhQPXX9G5i8k4sE8zMuZo86yRVj8KXKndwdnIqqZrnN06i3/Y z+0Lj3zIfRLh6UE7WJWMAJu31OspuotUbr+U3b8bcEVVszVzm2R14fQE1T6P7+NYBSdDBp OOLdRapFFOnDVrhEkuR5yCsIEfXDq6Uyxb8MbR01Ks1yV6rPOeKgNfOA1Usjgg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:22 +0200 Message-ID: <20240427235424.3075968-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 08/10] fftools/ffmpeg_sched: Remove dead assignments in sch_dec_send() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: +QOx8kHIryPl Fixes: CID1592383 Unused value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffmpeg_sched.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fftools/ffmpeg_sched.c b/fftools/ffmpeg_sched.c index e58b00ea97b..cff824340b7 100644 --- a/fftools/ffmpeg_sched.c +++ b/fftools/ffmpeg_sched.c @@ -2174,7 +2174,7 @@ finish: int sch_dec_send(Scheduler *sch, unsigned dec_idx, AVFrame *frame) { SchDec *dec; - int ret = 0; + int ret; unsigned nb_done = 0; av_assert0(dec_idx < sch->nb_dec); @@ -2201,7 +2201,6 @@ int sch_dec_send(Scheduler *sch, unsigned dec_idx, AVFrame *frame) av_frame_unref(to_send); if (ret == AVERROR_EOF) { nb_done++; - ret = 0; continue; } return ret; From patchwork Sat Apr 27 23:54:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48316 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1205168pzb; Sat, 27 Apr 2024 16:55:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWPRSTseTK3rbPKViWWHJM5+sv2yp51neom3pqxt9/Zq/o89Li13qsQ/EuYwDeBfebbdJP9C5OYBVVmSO/Y2C8hLue5hLeKt4GsFw== X-Google-Smtp-Source: AGHT+IGFafqj3V/ReDhVDEnVJAdK66shgqZUCU5seVXQA2qDtX0+JdCgfx4jbTk1PSKCO+RWNg7M X-Received: by 2002:a05:600c:3b87:b0:41c:b44:f917 with SMTP id n7-20020a05600c3b8700b0041c0b44f917mr799859wms.22.1714262149020; Sat, 27 Apr 2024 16:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262149; cv=none; d=google.com; s=arc-20160816; b=dftzeMSPBANqrSrFLIINoReT6QI1qMqISq8kKbVvguOCXlV6mlU1FJRAwYNm9fHrHh e/FzFBZBrDD6DmHYHtYblETddToPOBq0FrT+N6VeqwT0Xkr78GHAVBDEuwu0wC00lE3u vBgJnKJc8rWPobpDKURycKIYJ3W/eUmlB2gjex11qbZhDDbmBwXbnLrF6ik4X9do3bB1 R6dYtXtBHH0fY65or4M8l0WBqyX2PBJptpiIZkObYokELVU7mVIeAbLSycN4b3hu/fxh PxLM7gYaQK4aX8e9n6RQ2LOtcyHzgNfVLhJfsPy6n9gOQpwlV3EnC6NPdwThiXAEsH7M fueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=TkpNE2BH5AEypIhQs09QNIQ3WWeSMvlMB1Am+ZmOg8c=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=sOehvHihksM02lr9vNHDXiNqSg1PXiKxTs+oXF3lrcop5xz8gxf/Ytrhmiaiqb4eLw H4Zixf9SsvWF1mmFDnubhxJq5EXqo9F3G/Hb8N7pmatQlLh/waPTNcSD5lJetsrodHBu jpszAuPZpxnxLBpJ44Fkgotjxn1AWz0P0WFFY9/y+n8Vq/dti23/XLUiG9KeGqshVrzE yiEfE4mCuDj4DleRwJFvfrITdaWWWF2hgGMVSmFA1Vkuico0GMKOy3w4QI2Ly8/JTno9 O3GboFlXseMnOoJPASctORG1hINF7CQFhOOCnevWjCy43KP27bw1gKbIRTUjIqT49Wm6 8yWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="c/gpf3OO"; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gb35-20020a170907962300b00a526a7a6428si13638177ejc.221.2024.04.27.16.55.48; Sat, 27 Apr 2024 16:55:49 -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=@niedermayer.cc header.s=gm1 header.b="c/gpf3OO"; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A31B768D410; Sun, 28 Apr 2024 02:54:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E18EC68D3C0 for ; Sun, 28 Apr 2024 02:54:32 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5212040005 for ; Sat, 27 Apr 2024 23:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V+hIgQHQEpzs6txIxr3rchXXZH2Xm0Abnrx0pO4lajU=; b=c/gpf3OOdVK/Y3P0CDvG9sG3sw/eEPaoHL0SDi0TYKcnk1ZiIJB3V9evbbupGfz2/dxNrP doYjWJKbqWCW3pUYXplJKlMo9ms42r7TqzzraOwJZZo3bKdMBwonwIyUcxthA1VC88dF97 Kciucx43KhjL0e4ohkOiu7FLDW3HK5BZLkNTZw/yoC8Au8PSSUyFVLBgDIx/3112MyZwHK kFOHpDXYwvR6iGOklS0d7ZeTRrHNgjFxirbAYVNdDbp3HnhebwPmhsssnHMZJKuA28RvSz TBeElgKSBMSozo5nSh8DnDmnPEMFiRgSfs5iGy5HtNlzy9a3EmjurXQJ+AFaKQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:23 +0200 Message-ID: <20240427235424.3075968-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 09/10] fftools/ffplay: Check return of swr_alloc_set_opts2() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: IINFxUicVMax This probably makes no difference but its more correct Fixes: CID1503080 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffplay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index d4300d5d46e..63a9806fb80 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -2392,11 +2392,11 @@ static int audio_decode_frame(VideoState *is) af->frame->sample_rate != is->audio_src.freq || (wanted_nb_samples != af->frame->nb_samples && !is->swr_ctx)) { swr_free(&is->swr_ctx); - swr_alloc_set_opts2(&is->swr_ctx, + int ret = swr_alloc_set_opts2(&is->swr_ctx, &is->audio_tgt.ch_layout, is->audio_tgt.fmt, is->audio_tgt.freq, &af->frame->ch_layout, af->frame->format, af->frame->sample_rate, 0, NULL); - if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) { + if (ret < 0 || swr_init(is->swr_ctx) < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n", af->frame->sample_rate, av_get_sample_fmt_name(af->frame->format), af->frame->ch_layout.nb_channels, From patchwork Sat Apr 27 23:54:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 48317 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp1207814pzb; Sat, 27 Apr 2024 17:04:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBsenDHge56V8nRSGKhwFWyek3EeA/Jji4L9kP4GMBVye+lMQ+N+ltR1GYyN8AjjaelH+Uu0S4cL03LTncc0q3HicnoSVbXWF8og== X-Google-Smtp-Source: AGHT+IFXsjnMQr6XyPVOl/3KB+G8y1B+6U4dA/lYzhpln+1YkSHZOMVH23bcm4ggJHyRVCzZGi1R X-Received: by 2002:a17:906:68c6:b0:a52:6e66:dca4 with SMTP id y6-20020a17090668c600b00a526e66dca4mr5440385ejr.32.1714262667722; Sat, 27 Apr 2024 17:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714262667; cv=none; d=google.com; s=arc-20160816; b=bvW8x2v+Z50e/M+zUeXEIiinZt1nLcyXqlG8NNBhgkiztGjiqfCARKPTpKuEnW2DHG yje11igl5dP8qlc3EfxxhokSGxfRTSJ7BsBm8860sH+7vE2FbBGx9Xl4wf0IlDrENA6j 8UWEjnZMxA1cS325NMbFWPM5uOu8zn2P5T4yCUHai8FVPl8ByJO/siIEnIKnPYuawjer WG+XZkaqB2SXOt9miXazlUOu3aFMyU+eCgX71hw59KyZxKBeX95o2PPesMYJ1uuCtNZ2 33C9mijyBeKiltRUqqX57xCcWAm50wvst9N5zfd4Y+A+ZM00911IKyjNI0p3xVCQcVyn xFEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=Ex4JZOyDd9qNQZUvENJ4E3+lq+sngkzALSi6zakZDH0=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=lhBnyZLze1MqENB+CJLtr6IgpPtfvqlLFjOJvRJcF47BunA6NChRw+yGWbLPajtivv WjDJ+mWhKtM90h4N0oumMeb9xJJ2RfThIfHHHRJ3ASXxGPTFiqWnGGXYMljh5+XrNtph otwKQ0XiLg0qnAbT4nkyVDD3B+1UKhYuwCk9kUKdFFdU/tGzbBkXERWMlnb9PGK6vVA4 MXKQhHcbeTLR9QeGyCGvj+Z9OZR+Up3l83d1Ho2vZjNycod4aA/dfENp6yjSioctjyto 8DnefSv1BeCsiVZOpyHRDavt+aVRlfPr6dFkrHGw7HtkaEEWqELjDK0x2ynbhvsd+DjO cQtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=WwbLAtBe; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v5-20020a1709061dc500b00a5199ccf789si12322198ejh.182.2024.04.27.17.04.27; Sat, 27 Apr 2024 17:04:27 -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=@niedermayer.cc header.s=gm1 header.b=WwbLAtBe; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC31768D41D; Sun, 28 Apr 2024 02:54:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99FA268D3E1 for ; Sun, 28 Apr 2024 02:54:33 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0D7AC240003 for ; Sat, 27 Apr 2024 23:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714262073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cBCR9vvcONBUDHCi+5SomMz6iOA545Ar2SyPDRziw+E=; b=WwbLAtBeuJSdLxjpTgvlyEUINpgKCrFDozagwWPaduNFkZAEw0fKgcEiMnhlBiuJ8qmOqa Mj720I0r0/laHgfBY2D0YgURqlw5ZIa8wfEU4ac4Zcbgfbkn4+Wl0Sl8p7DK0CCHixRNE6 Fhbi6r8Cu3xUXD5cERYhLpLZ8V//itPHu6iGc5VWJ0Mz8m4sz9DTO07mhGBHSpolXvJk9I 2epOQy4wwy9sCQGKbClUowdVLjgCUACOEzOsLsJ++OJgV/UjLJrjuzkMhSpbDtcqP90oyo B1xghgXi11l5dBf6eO8D9rw9gYv7lq0YtYrZs/vKzPUR1ew/I7N53MW3B/lpKw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 01:54:24 +0200 Message-ID: <20240427235424.3075968-10-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240427235424.3075968-1-michael@niedermayer.cc> References: <20240427235424.3075968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 10/10] fftools/ffplay: Check vulkan_params 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ydnrNzww+i85 Fixes: CID1550133 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- fftools/ffplay.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 63a9806fb80..cc00e209d52 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -3839,8 +3839,13 @@ int main(int argc, char **argv) if (vk_renderer) { AVDictionary *dict = NULL; - if (vulkan_params) - av_dict_parse_string(&dict, vulkan_params, "=", ":", 0); + if (vulkan_params) { + int ret = av_dict_parse_string(&dict, vulkan_params, "=", ":", 0); + if (ret < 0) { + av_log(NULL, AV_LOG_FATAL, "Failed to parse, %s\n", vulkan_params); + do_exit(NULL); + } + } ret = vk_renderer_create(vk_renderer, window, dict); av_dict_free(&dict); if (ret < 0) {