From patchwork Sun May 26 23:52:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49275 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958534vqf; Sun, 26 May 2024 16:52:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVfXzdNnGbSIqQZKCz08IulSlCgEVpY+3ybINQf99pWxj7R7tpq/0nBQyOwd018L74T1H7Rc63fAI5Z6kivE+Y32RogoYermR7hHg== X-Google-Smtp-Source: AGHT+IHwF+d6uxoldl4RVzzo/Kdlh4uAmANQThYeaOCxwBlSLaAPokZFdTM4kEC17iWEkxeuAmBL X-Received: by 2002:a50:d4d8:0:b0:578:5fc9:c35e with SMTP id 4fb4d7f45d1cf-5785fc9c592mr4882904a12.2.1716767564658; Sun, 26 May 2024 16:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767564; cv=none; d=google.com; s=arc-20160816; b=ECgmzKIYhoJTiYq0u7QYP5N5ZVAiCZ8vPHL8tiSIbd7kBNjBd0qQqau3l3tz7S6N6P nPFtbV9mZa+fF4v28A0tH+gi5f3NwtpAIAeWcPGk1hhdoE0tNREsXGUOa7ZSD0Vkp+Y/ UApcQSRLn2TI3lTqIHkNKHhJi13JD42C9WhDT+ZmQHe4989pmzDL6x62XCNVcxdPe7TW hJdUvxfuGLPMTcBaBsED5RFqJ/KW7GcL1cTEXJCR4jdNeWFUOnPKb6Fla7LfmDtdEEwV rMS+GKGGpH1zYxBmbNgduUXZeh1Z7qqX5gKBFLlwWQtiwicLTYUM1hxzLQ8kWhls5MmY MYcw== 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=aJcobF8SH5nM3/dvs4OnT9bLi+ePDWw5RfFkYtRGy6E=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=BViKxQoCNyzqzqQLnmUHhvUO/tuWDEtR79FbkIbTF2GXKIvIBp2wVsbZ7kJqqfs/te 0ZSPGTRQfoBH3ZvrNcthwWyJ38HYwqsK5qONVloas47NlNsMvYD7NNk3edP2j3vr4ojx TPMm83zcplzCSL0+lAw0Xfy2mXyHFcUuOhG2lSJ4xG/tGeZLMHxU3dtLuc/ztl5go/uo XzHQ0zXhqYr5QzNkD63SSbA5Y5lcFycg3whw8xurkpIIRzZItriuaXWFmhNk/VtzL195 5wX0fG5kC0d8PypYupgY9pCKycTXoLSlBbfOBd8Z7pirzG9xhQtVJ2wnFXEjw6iDe04E t12g==; 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=XFRkxVaD; 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 4fb4d7f45d1cf-579c0082468si1843893a12.355.2024.05.26.16.52.43; Sun, 26 May 2024 16:52:44 -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=XFRkxVaD; 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 7D39C68CD10; Mon, 27 May 2024 02:52:39 +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 9F94C68D01E for ; Mon, 27 May 2024 02:52:31 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id ED286240003 for ; Sun, 26 May 2024 23:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767551; 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=2Rq4W2swGFaUtwaDgibaJYJ9cYtDdKlHrL59N9cNzQo=; b=XFRkxVaDV4lJ2kXN61im7QgiAxR7IC1kWoOFayEMBhLYwtdyzoiZRgLfy+8tQzoH37Oee6 ZKNYrERGmWPsJy1t8eFuVMPVf/tCkT+AoYmkOyIdr+XErgt/qA8RYt7H1ccWaS4L5O+Znq pzec8sAkASGhjRDOpuH7XuXitBuusUxxCpWBOv+VMwP567PCIHy6TMHLKYukbiHtv96QD1 ALnmzU4FkgCodBUqsu0CO7iwzJXWFzgAJR0ipJEjQQ04JI6UrGTcPcIyranaAQlCa/kFLV Hfjf4DJ4C2xLf5B3z3NU++/52zBpXUR7nU+RIkEK2tZiuBGpEXG17eAzogsYuw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:13 +0200 Message-ID: <20240526235230.2876318-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it 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: jBoP2L/vv+mO Fixes: CID1591878 Uninitialized scalar variable Fixes: CID1591928 Uninitialized pointer read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/dxva2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 6eb66c02e40..75ca84d0fe0 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -806,7 +806,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, unsigned type, const void *data, unsigned size, unsigned mb_count) { - void *dxva_data; + void *dxva_data = NULL; unsigned dxva_size; int result; HRESULT hr = 0; @@ -828,7 +828,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx, type, (unsigned)hr); return -1; } - if (size <= dxva_size) { + if (dxva_data && size <= dxva_size) { memcpy(dxva_data, data, size); #if CONFIG_D3D11VA From patchwork Sun May 26 23:52:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49276 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958580vqf; Sun, 26 May 2024 16:52:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcEkSYRB+8lx5PTxLe0h9NtHfxTyPnlQdL+5pVUAZIvDXXZ0CG55i+jPQolhe1st8Xvm9fEjF6AecfJ5RHg7pIw+Bk1vQnZbIQfA== X-Google-Smtp-Source: AGHT+IHpDVLknTCHKq+0z2CNf848f16IxNGSE5y19PXy/W161VLUZEfLfLJfyav1AkFPDLwsSnr1 X-Received: by 2002:a05:600c:2111:b0:420:1fab:177f with SMTP id 5b1f17b1804b1-42108a0325bmr54619835e9.30.1716767576066; Sun, 26 May 2024 16:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767576; cv=none; d=google.com; s=arc-20160816; b=uNtzVB9ZqCvEVZiw6b4ljM4SzKyAINuvNDvUpXxr8Dbjq/SJTNXjFofdPKfJiN07fr Vf8Gw+znAh76b6vWKTR7oKMtp89DvtLfz9W9lx06o6n1Vt4IMaQLh2T0B9hnkJMAo9PB F8jLK5REjUnyt2TXCo5vj7Unf7K0hl/HfgIpwQfTRYLj5CfQSNNHRBSka93ck4jQhDvx OUWXyvbMj2bCIZkxPcG0OovlSojO5pkIfFUeZ8TfUnRi+/qzdCaDo/VgL54yLSKC2ggm 4KrzuGJYSzE4jNEP94R7RthlNJOtoYTgmT1z1GbRu+YrXev1JoNKovU1T1jhSP+KZSJQ gMYA== 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=2IN3FhULDjnA7wRcOJRQpZUlltYSd5Wyez5u5fLAtUQ=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=hUI/oT+eqzuv/5tzs2wowva7u//C17ZpJmUYitIn9m60SFZ8JRFJRPefD3Wn6euqnI I86E8SaYotKggxKfJSRAt2Hx2g45rXcKVn7ovVV/xhG1DiWeNOk3YYlFKdcgKsmDDvic IauZyiLZaysv9sEEKXDva1NazOdOl1q415USWAHPt7Ep9BTZtQ6aNEHw3XjjV1v6bl1I 0ncApdOHbF1abCDoSD07j/Yc0dHFx3yN5EPN+VOUtinpTqHhCwM7MbJaaiHIoix3dMAO vYIeblEgZw+WP0VYc844XU6e/ry1uLZCqErFfaNzp4Nx5iUah5FnBxvRJEo1ec4bMIXW xoow==; 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="Yui/kbmw"; 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 4fb4d7f45d1cf-5785dc80fecsi2950232a12.493.2024.05.26.16.52.55; Sun, 26 May 2024 16:52:56 -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="Yui/kbmw"; 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 A421C68D52A; Mon, 27 May 2024 02:52:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0ADEF68D4F4 for ; Mon, 27 May 2024 02:52:32 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 201A860002 for ; Sun, 26 May 2024 23:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767552; 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=203tsyP25SMmepN20xPir5B+tGhxLyqF5hiA9uDyLlk=; b=Yui/kbmwHQgLG3hVpJyYVho/d0/H/5QHFOCA78xUQ9dhy69tGd3F3DNDR69O3e3tErOfGt Q90gfAhndEiyvCnkjw/8t+opN2Ve73GxWrpSY4t6hJYojfwCcf0v2BDR+pQfKhjEh1RhGO K9G2ZhL2cavZM+fQ1NFJ37Q1HS374RR968ZOGB5jsLQWQg4WCp4rh5SFH+0D0dBAkRl5bn TTwtqMfmx6c7qxPtdqpRadDmJ4vgJBlP2sfNDFf+NjtO+44R7N1T23eKs/+kceZs+kF1mc vqJYfjU2llSEC///Frg84m62OQqXaKE/nWsd7ci05NpcYmZwFyUStnfL3BM3tQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:14 +0200 Message-ID: <20240526235230.2876318-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 02/17] avcodec/dxva2: Initialize ConfigBitstreamRaw 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: Iv9GNKirkAZ/ Fixes: CID1591894 Uninitialized scalar variable Fixes: CID1591906 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/dxva2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 75ca84d0fe0..550369ba51f 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -118,7 +118,7 @@ static int dxva_get_decoder_configuration(AVCodecContext *avctx, for (i = 0; i < cfg_count; i++) { unsigned score; - UINT ConfigBitstreamRaw; + UINT ConfigBitstreamRaw = 0; GUID guidConfigBitstreamEncryption; #if CONFIG_D3D11VA From patchwork Sun May 26 23:52: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: 49277 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958628vqf; Sun, 26 May 2024 16:53:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXPN0Itlp5FrYfFxDKcrmtTWQKftBFrRMuAWYffROHeCIQ8Fm5cSYQtMPKgXBSACoYU9EHwgxmeyZQlCBDBhlJ92DYpdcFSP7Sxgw== X-Google-Smtp-Source: AGHT+IFgb/zAip3xCNjCRjR4Cn4hlO4x15bxQlNFHvbNCz/31bCTl2E7K4CJfjxZPf14pvT0QILu X-Received: by 2002:a19:5e09:0:b0:51f:2709:3641 with SMTP id 2adb3069b0e04-529645e4f17mr4293641e87.26.1716767585572; Sun, 26 May 2024 16:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767585; cv=none; d=google.com; s=arc-20160816; b=jy0Mnfh4WkVq22XlTXrsopxUf7lN0pvJdkov+bzcoWJTgOGemE2yeM5jX/efMJ/ebQ F41GBqihFG1p2GbSao+1RAJoSBZr7On3NKywLD7nd4hcBlaDonL/l5dUSH8R5KCuP/TA nGHHSz9LLJnZypJfkT7u2KKHdicVLQtFNo8dGW2O0EDmu+cGJpQPwetkB0sDTshVGffu 2yfQSXkFzSPOAh94f6E7+DxdGnWoY+Vhk3g1VhD1CSr+kOmudJshEIRtuZB3N98XBbMU 5oJ1YGjxXKpZfnMlwnzExLFaLM+YlBeoMt/VbzM+G347a1QxWdjdc5Zg1JTeSUlF7Hc+ lfFQ== 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=Ret8NGdv35rXF1wpXljw+cn6WoI5rsg05PKFToxgfCU=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=CNOobrQ9mtWpGMqzRgVxJ7ac3IeCHKBbQ54mvtKhtPKkFPljGjWul+4GgavyKfNEhE CFDqvq6xCIHbFKpER33uZnaMrxHDvoN6S6fDP1vfiLfdjQgsuAtZ3U+oBhiBsAkMOoKD tdiH656E7lMBsEgRzuqi6NP7Nl0vQluj9FLM5LCNXCUuPvygoacS+FVIyf9QHo5XYwlV kLaex7M+e0BQAWKGROMFYB8AT6sfjnc9xrDHeCQUgxYKYSWLjM/vdHxrbBrCWr3Tqra/ 8hah+qzhc28O9Tn/ZNys+Pwgbgr14TAiszgIsq+56tRkjnmxZ2k5+D7/AcvxPIh3zqyH Zt+g==; 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=LH3CDO7m; 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 2adb3069b0e04-5297094ea18si1967073e87.446.2024.05.26.16.53.05; Sun, 26 May 2024 16:53: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=LH3CDO7m; 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 A75A268D515; Mon, 27 May 2024 02:52:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 29B9A68D4F4 for ; Mon, 27 May 2024 02:52:34 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5BE61C0002 for ; Sun, 26 May 2024 23:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767553; 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=dQ16opqPu4oTgETho0eeqFBx/xT3IzQX5JKajRd0Q/w=; b=LH3CDO7mqULUcJiTlJ0NY/vyjaDj6qZDLeYEpn9AhEUU1E3a5oGlZKBA1+CmLmjla/GRbj 9i0pDFeNeSXn6/9ErW0t2j+oCMKR4fqwqC3Pz3ZDe2faBuByJI4QbAQ2S83LGU8eXmg71q R8mlMXxLBvW553WiVpmlTJPcsGwMMQVycXsSCOepqqEWLjSTatMNg3ITzWZlnd0q4yXKmj ORfRNEOVth7NwJzXUNT5Izfi/Wn+ApZQSs4tYIwbzSeUSpo/yB4ywlEq3oYxkNnYfIG9q1 NvCmVqXcmq0iiNLxPtQRTSRQ61UlYLlbCWFmoOImS/pplXtfa2hvYHtm/C4T+A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:15 +0200 Message-ID: <20240526235230.2876318-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 03/17] avcodec/dxva2: initialize validate 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: G3brlKtcHQ3A Fixes: CID1591915 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/dxva2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 550369ba51f..1a33c8bbac7 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -269,7 +269,7 @@ static int dxva_get_decoder_guid(AVCodecContext *avctx, void *service, void *sur *decoder_guid = ff_GUID_NULL; for (i = 0; dxva_modes[i].guid; i++) { const dxva_mode *mode = &dxva_modes[i]; - int validate; + int validate = 0; if (!dxva_check_codec_compatibility(avctx, mode)) continue; From patchwork Sun May 26 23:52: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: 49278 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958660vqf; Sun, 26 May 2024 16:53:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVSD6233BI6gsW3ATYf9ogx3thB2sOVLWXgTBj02q2pNoNkHGiqVgJ4dDj9eBMkuNe4jYoXIQytonKTZ5jjpf56GzFamXJ7Y8WNMg== X-Google-Smtp-Source: AGHT+IGiOvBBSJvCnPfMpw+9S6IiA4ggLfDOv/F0jWzyBZzhy2HhKL/alMYLi+/I0Puv7MBkWFD6 X-Received: by 2002:a17:906:3142:b0:a59:cdf4:f939 with SMTP id a640c23a62f3a-a62641b876emr450508266b.3.1716767593536; Sun, 26 May 2024 16:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767593; cv=none; d=google.com; s=arc-20160816; b=CD+Z3uCqeSgB3CQli2vHbaexvUB4oV2d7WWW4UQ/TjGBgpoMqLBwlAqhJEiH+VDtCQ BGd34e4kmPsLOoauqICIktIjaoNRACXQP3f2PGaVYHl6evQJbvk7vNZ9fBx18R+W1TZh psr5TNGNvb2kkc6tFQrfgVcGFu33Vnwrl4bPlnT8ZgNnCY9cUJ1SgmVGj5xo/vb39IgW 9KiyvyMDRKDhi+onBIH3lFOaYRijFREc5csr6T/6ZJdX0hdgckeB/2EowxfX19i4ghaK IhdYsF+8BbTqhxITkfsZry5P7U6TPVlGeV2LcjAYie62p4A/8HihXxdD1R5GA7ycYRdZ wIOA== 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=DLFBFaC34sFYUGeF0V2x7T7ZYKcPdFwcq0wcB4PLSUs=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=d5nU/B8UEZVnMkLP77/+h4HCzVOBqu3HMPpTum0rb/LCXpk/8bQcpNSWMDqPQi7jMa EO7uZxK5eeuz1adr57UDZiHK+3ydQTzXEWqw3d5JmSLDQerVdujcarqPbkRA5o2x3k9o u3pdwsnOXpxxRxStHTV7Ow6TocuMdiZRnkA0zjP5TG2idi08WdzeuYVzEn5l9mKVJJc3 10F26RE3c6nvMpropPDwvdM39JlzzgI6XIYsMV3j63uD+zBuTzQgZRx17aoqcbIb7KQ1 1I8tDIOVfKva0lZkWd34BgE4FxcCTV9Qn3n+97MMtkXQk0PZeLudB49cRPiBDAVt2e5Z 1IAA==; 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="b/BjbRSz"; 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 a640c23a62f3a-a626cdcfc60si328132266b.959.2024.05.26.16.53.13; Sun, 26 May 2024 16:53:13 -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="b/BjbRSz"; 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 CA20868D566; Mon, 27 May 2024 02:52:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 46AD968D4F6 for ; Mon, 27 May 2024 02:52:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6CDF01BF204 for ; Sun, 26 May 2024 23:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767554; 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=fQbHtnnz+BEP4gziY2Sf6LolQn3+YGk8fSx7Lf80Qhw=; b=b/BjbRSzOKrJerEnyXpGeqUoJlRuiDufgYU5zqvybcIRWObBDFzg2GJp18OEMnsYKJjio/ mx8utCrMApARnewdPEjPrpjkRzmqnCWos5sgL7YsoEy/j8WXczRhcY5jo2wwE0RFr6y9VS AJqddDlFbeG62xyw3nqNQ6umTqRqwq9atKzFRSDwZFrArKQ68m+Wp/3FJuOVlybjzmMp7c vilQcfKv0SIKCA5xWUtLBZgk+GavPo0ns59zA20lotGVc6hT5XUVXI6UGACSVGNcut/S1r +pC+GFdSHL+fCVXnJrziufYyJ85Tcmudc0Z4StkPdM/Jd494fGTZ6aYDEVNCaQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:16 +0200 Message-ID: <20240526235230.2876318-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame() 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: A8sFHCi/gfHq Fixes: CID1591924 Uninitialized scalar variable Fixes: CID1591938 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/dxva2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 1a33c8bbac7..22ecd5acafe 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -906,7 +906,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, #endif DECODER_BUFFER_DESC *buffer = NULL, *buffer_slice = NULL; int result, runs = 0; - HRESULT hr; + HRESULT hr = -1; unsigned type; FFDXVASharedContext *sctx = DXVA_SHARED_CONTEXT(avctx); From patchwork Sun May 26 23:52: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: 49279 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958684vqf; Sun, 26 May 2024 16:53:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXfAUpPjK/8CB42Jezq+M15oJvuACl9GiLdEuvaGdCVSxV6t38Z2/57cTk2/6s6Phlgti4V+9bEci7V0Jvqgkcn/Y81Rit+Id7v3A== X-Google-Smtp-Source: AGHT+IGanMCE+301gNiqEnysob3+JDYI9lwi748yQZ2GfhBWTEGYZ/VgWLN6uA1sSfyJeJsMhmCf X-Received: by 2002:a2e:90d9:0:b0:2df:c2b:8c84 with SMTP id 38308e7fff4ca-2e95b09452fmr48344061fa.1.1716767602960; Sun, 26 May 2024 16:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767602; cv=none; d=google.com; s=arc-20160816; b=dA+XqWvPRZ27ECUWHAaEtV5wurzXIMkioCA30PCb4MlP3pzbvMvrSCkY2dVPrq4G+d XBFnxoICrw9iXp/Cw2809ZYDaGAQaaZcnjwnPBmzT4bmcX8YCqjeVCe3uRNMluXWiMUX R7/N/BYjX8FSkQjr/nyVwTJXyVDOdGuHKs3xNCzcsW5lV0HaotJy4YHD3ihwFhsAbaDn loAZJRnKUN49eM6J55IR5nQsV+MLDggIyJ1+4tXGH41OOmLBfWTz/t8QLcyHbq8nPYQd 0JuefUO/PWSfwMCNqwbiQoayZ8unfOL9nQoYc6Ew/U8HRQPV/bN2fnqc3GioVLkqWup7 oEfQ== 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=jb0eSeNa7Al528JQksfjahdpt84/ozkN/jDF1aUWvQE=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=DopcR/p/QrVRbylh4ZUJNe3vUG2Zf3qIkNlaWMZ5AxeYJ8uW5ir83jvuI0zgFjuXfd ve/ZBA5N/DDstKJSjdZTUwy5yyqyCM0X0Mzuk+t++XK5g7csfquIxvVoLgIm7Lwpp4Sf u6oY4WqnwLEJrpjGiYjgV5gflZbD0DZdFGwKJx4Ed8CNkCVbuDxYpaWJBMKsXbahACeg 3e8rdGk6Eagf+XMKqioigZN/mwq/LcuNzRqZ4O34klXn71Jn4PwVrCQhyiXmJBU6mp/5 Ymo6OUwe2iRHIy58xM/7HBkfH7mLNBUrEGUTccDv1F8uDwXpj3hnakUAeUgKhAU9x4n0 RGAw==; 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=eHPknPiw; 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 38308e7fff4ca-2e95bccc345si18799171fa.42.2024.05.26.16.53.22; Sun, 26 May 2024 16:53:22 -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=eHPknPiw; 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 CAD0968D56D; Mon, 27 May 2024 02:52: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 CAB6C68D4F6 for ; Mon, 27 May 2024 02:52:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2EB04240004 for ; Sun, 26 May 2024 23:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767555; 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=HGqEOMTsFMUAPHUj6eChjqMt2x36GtH4JJ9IAgKgg1A=; b=eHPknPiwjSuNHWFnFH5EnuGQbHkqUfUO3CbyVYZ/eZqepm/NPhHbcjiJxygfkB+kKS9U/P SW/yzmAs6CMQR0kEVBcQ5lJr3ckE4N3KJg9RZgjFjkvYMljUFcXLwBiOWEL2neG99d0AKG lUikzcXwjG+bqY6UjEru4FBc82e5cJ3vaGUNowTDPpnbVKJYa7gc/SuciDtQxWl8PRnLk5 9h1f0KSYgyBVNb9sl697yOjV+Cx6JohxEv/y8yxcJVCg0cXoCwJh9p8y6AM3/5vHkclUai B7inMWLm/pbz2+WL+uSJAtsE1rXxby/I9XBnx+N+AnwSslU0MB3DuYEFDDyMjg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:17 +0200 Message-ID: <20240526235230.2876318-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 05/17] avcodec/dxva2_*: Initialize dxva_data_ptr 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: yvZaRIPWNIYO Fixes: CID1591888 Uninitialized scalar variable Fixes: CID1591925 Uninitialized pointer read Fixes: CID1591933 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/dxva2_av1.c | 4 ++-- libavcodec/dxva2_hevc.c | 5 ++++- libavcodec/dxva2_mpeg2.c | 5 ++++- libavcodec/dxva2_vc1.c | 5 ++++- libavcodec/dxva2_vp9.c | 4 ++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libavcodec/dxva2_av1.c b/libavcodec/dxva2_av1.c index 1b555106599..ea97fcb87e5 100644 --- a/libavcodec/dxva2_av1.c +++ b/libavcodec/dxva2_av1.c @@ -354,7 +354,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, const AV1DecContext *h = avctx->priv_data; AVDXVAContext *ctx = DXVA_CONTEXT(avctx); struct av1_dxva2_picture_context *ctx_pic = h->cur_frame.hwaccel_picture_private; - void *dxva_data_ptr; + void *dxva_data_ptr = NULL; uint8_t *dxva_data; unsigned dxva_size; unsigned padding; @@ -382,7 +382,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, dxva_data = dxva_data_ptr; - if (ctx_pic->bitstream_size > dxva_size) { + if (!dxva_data || ctx_pic->bitstream_size > dxva_size) { av_log(avctx, AV_LOG_ERROR, "Bitstream size exceeds hardware buffer"); return -1; } diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 31d74a7164d..5eb166c3075 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -248,7 +248,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, const HEVCFrame *current_picture = h->ref; struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; DXVA_Slice_HEVC_Short *slice = NULL; - void *dxva_data_ptr; + void *dxva_data_ptr = NULL; uint8_t *dxva_data, *current, *end; unsigned dxva_size; void *slice_data; @@ -278,6 +278,9 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, } #endif + if (!dxva_data_ptr) + return -1; + dxva_data = dxva_data_ptr; current = dxva_data; end = dxva_data + dxva_size; diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index d31a8bb8724..5de062e5308 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -160,7 +160,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, s->current_picture_ptr->hwaccel_picture_private; const int is_field = s->picture_structure != PICT_FRAME; const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); - void *dxva_data_ptr; + void *dxva_data_ptr = NULL; uint8_t *dxva_data, *current, *end; unsigned dxva_size; unsigned i; @@ -186,6 +186,9 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, } #endif + if (!dxva_data_ptr) + return -1; + dxva_data = dxva_data_ptr; current = dxva_data; end = dxva_data + dxva_size; diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index f7513b2b153..04f26ddff66 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -197,7 +197,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0; const unsigned mb_count = s->mb_width * (s->mb_height >> v->field_mode); DXVA_SliceInfo *slice = NULL; - void *dxva_data_ptr; + void *dxva_data_ptr = NULL; uint8_t *dxva_data, *current, *end; unsigned dxva_size; unsigned padding; @@ -224,6 +224,9 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, } #endif + if (!dxva_data_ptr) + return -1; + dxva_data = dxva_data_ptr; current = dxva_data; end = dxva_data + dxva_size; diff --git a/libavcodec/dxva2_vp9.c b/libavcodec/dxva2_vp9.c index ca8b3b136da..f4ab91c580b 100644 --- a/libavcodec/dxva2_vp9.c +++ b/libavcodec/dxva2_vp9.c @@ -172,7 +172,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, const VP9SharedContext *h = avctx->priv_data; AVDXVAContext *ctx = DXVA_CONTEXT(avctx); struct vp9_dxva2_picture_context *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private; - void *dxva_data_ptr; + void *dxva_data_ptr = NULL; uint8_t *dxva_data; unsigned dxva_size; unsigned padding; @@ -200,7 +200,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, dxva_data = dxva_data_ptr; - if (ctx_pic->slice.SliceBytesInBuffer > dxva_size) { + if (!dxva_data || ctx_pic->slice.SliceBytesInBuffer > dxva_size) { av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream"); return -1; } From patchwork Sun May 26 23:52: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: 49281 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958740vqf; Sun, 26 May 2024 16:53:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVAmiSY/Yo4NMR+LL3rDuwFgLicjkibPR6JnBUjlxglkIAPlBnrznspWaUPfMXOsj+j8oafoSmVAeK3zJPCakPaARaAoAhvb97grQ== X-Google-Smtp-Source: AGHT+IENd+MbD11SM7CtoifFMUvMBuQyWskgJkTGYyQ4gwKaA1ySuZleXH5cVHZCRAhLoez1l2T5 X-Received: by 2002:ac2:46fb:0:b0:51f:3fea:cbce with SMTP id 2adb3069b0e04-529668ca211mr5118944e87.51.1716767620141; Sun, 26 May 2024 16:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767620; cv=none; d=google.com; s=arc-20160816; b=vAjA6WvLB3waQYkIZK25C4zoCkH9LFf4m3FB/30io+LOdjopLyMpDCuFGmt+iGL3+z kiMaTlXRnDwVdCbVLhlP3qu0LjvrajslqcebVQG2OjcHkIwhg4P7vtKDdCeeEGPPjMay vi2SC38GNaHA+H/kPLwoz0z+lrrkBGLBLMDuuAR4LXED+nslYVKxDlur9tAcu4wfrV9G tdCfYTKdL0Y6xHyNXeRgKIbI5flXL5752HftL53XNVOOZy/+NcIjyYUzUmCpr7NKVP3U 0ykPz/niw5j++7qRFbqFSckS0GIuQk2bdA9HhQFcoGLay764XVTFLaw9N62ngfo4wXLh J62A== 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=rjXS8jSVWFY8PD6kY/xjAU+ybZm6EmmJvwsdHgyGJJU=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=o7RhF3FWc0RKile173ieluoXHS7EftiDmdSpZY8YbcM8E+mYrL3X++iWQkN+N7BYIP JSpvslxYMq/cOyLBsAXsfhuIRNUQGqPEzvp7Io/ko/GvgxL2ddijUD/kyD2I+3EWDLoA 1RZRGQJ3c1mHBgTERI3ErDWRcbBUwcSghxnIRkS16TorlWPGFnHe0fP+dGRI2muuqSor cPJZaMcL7ZTenoEBEee8KJZtmOUYWDgyxTzvkzwY1Bqyc8X0Dc24KDCXO1bEAFZHJH3t From1qYT6+xW65gxWlEWD31SMDNWoOP4o95r6zmxjPHS9+otqnC6BvjX4f6ymrVLPBlu BMKA==; 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=baaiJ7zS; 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 2adb3069b0e04-529712f36e1si1949902e87.581.2024.05.26.16.53.39; Sun, 26 May 2024 16:53:40 -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=baaiJ7zS; 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 0942068D5AE; Mon, 27 May 2024 02:52:48 +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 3E0B268D52C for ; Mon, 27 May 2024 02:52:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 67FF720002 for ; Sun, 26 May 2024 23:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767556; 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=exNLIXSrNz0zKpvjunSrfAyqk3yz6icB8rpGfk04cjw=; b=baaiJ7zSC23a/hmchNY2Eq4E2UwktpSBY4gdhmVikKjDUG80iklp53X4kfVBW34h3GVgWa CdGrZpIRJ1s7/Sa+s5sC6iJrYY9+hnKoLXSY1++7MNuMVh+t0braa6Enpns5lN1obKNWCH WrdwuKIMi1b34Uab+1x5n5cOLVTMzAei75QoZOgEK2oWncYeWDXnDrYSzyGbmZV1owx/7n vuWHltwH/KrHi808xSTJzpe6KOk9PxAuPjIXBWLfKf+aMvf/Os4ms+QA4RmwXqviIjx55p 1yXS4xaDD8+S5XlJe0SmuXmjQYWjavzf5J5o+ZpQQsYVv53kTajgfUYH5pPEBQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:18 +0200 Message-ID: <20240526235230.2876318-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 06/17] avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure 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: 4wExM+tRlFrV Fixes: CID1591911 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/mfenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index 2c68adbdc73..b8f8a25f434 100644 --- a/libavcodec/mfenc.c +++ b/libavcodec/mfenc.c @@ -249,7 +249,7 @@ static int mf_sample_to_avpacket(AVCodecContext *avctx, IMFSample *sample, AVPac if ((ret = ff_get_encode_buffer(avctx, avpkt, len, 0)) < 0) return ret; - IMFSample_ConvertToContiguousBuffer(sample, &buffer); + hr = IMFSample_ConvertToContiguousBuffer(sample, &buffer); if (FAILED(hr)) return AVERROR_EXTERNAL; From patchwork Sun May 26 23:52: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: 49285 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958797vqf; Sun, 26 May 2024 16:53:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJkFbsLkfKgF+FYiMTLW3PJ31y2ukqDMQc3JxKxapGvZQZIt66YmQpjilKFqI0/Cz9Vd2ygoIHs0zg9IuwyY8J8+BNCIqbmUxVkA== X-Google-Smtp-Source: AGHT+IFnWbV5bRGiRn2RAL+3XqTe7SMaj/jkKC/YUkNguqVjQ/d8FqaPICBOpVvFjcYlsF8ou2Rg X-Received: by 2002:a2e:300b:0:b0:2dd:374d:724e with SMTP id 38308e7fff4ca-2e95b0bcd82mr47090221fa.1.1716767636423; Sun, 26 May 2024 16:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767636; cv=none; d=google.com; s=arc-20160816; b=g1yaQSYVVY05hDgYOxlvbyLR+wZWiB7ei74tMpukQAzCqwqBEV1rwVNYtnjmwOvriv 9jof80TwdYij4QrM/Rij6bMkStJwAf9uxIRvxsmt4oYxZCa5iVDlwjz0H+wBNR3RV5PG 37VBDc8KnnLKolNgxuNPqy7J1TyaM4GLzuduwxBk6hYg8R1za6+ORwy4AVVfbGddR9kX ZrV5N+ADbGqEGRgnQ5MaeVSne3IvcnEydAFleIpD8wlfCnCChz7s0La/DcX4FWhefU7l ipSoqU9bOdf1bxf2fkqW9w8UOAsCGAIgPL8kyD17JPv7HfXVrX4iOSG2EFpo/OCuRWL9 ErpA== 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=mkmlNDzyziOLfy3TVRMpag9l0SDCPk/+SSSDpzBtHzs=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=FH/bCcF+vlb4MWVj+0Rm0KQ9LdXHyz+cfwhOU35KCX9CovSr8ZnBZdgU6uE+EjY6TD W4L0uhker3bc5FVPM68KnEefKhGDo+LAMOS5xTMmk4sm19Cktm85ypzf2jNSLhVdNFtw 55x5QhArh2Z9999y4FsiUkoEQ21OMmrYfkP8u7/vlTOePZbi2C67GT3kSTpEfE5sfqGo mcSE2TAfz/Zx9FX607/Az/SNGut6Gc7kNhmjY+RH8OMN8PpVd4v0q/oB0giTv+AFUPrt OjLdczb++lyhvzcLkHOHHCGFjDx/HBIEk+oIA8VAGbqsfO/9EHHqChZScvsMdgL2+psf pV6g==; 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=KVlz9D9M; 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 4fb4d7f45d1cf-5785249777asi3394329a12.395.2024.05.26.16.53.56; Sun, 26 May 2024 16:53:56 -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=KVlz9D9M; 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 81FB868D5B9; Mon, 27 May 2024 02:52:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BB0F468D521 for ; Mon, 27 May 2024 02:52:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 22E781BF205 for ; Sun, 26 May 2024 23:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767557; 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=lnyM9/rm3ObWEwXhD+pOtS5wvJUz4beKbLfAFRETQSU=; b=KVlz9D9Mki2z/2zqvZzln9h8Bs4Owb5haPLk9cIoM4iad8dVYpaDmh/4fL6s23qN76NR7v SIzPPKkZ9FgrIXdvMbsFPsWfyIKPeiDhIuCqPGXQ+Z0C9ElMUAWTIoUxDfObWkyfCnFMje 1FA4d7G5mwqFpu6TlRWgszRo2mNqo6w2z68/3nIByCw2WoezDvNs5Coecli7eOtzuEkpLH XBiBWBFaIqagPLek/FqW33WsrgFgeYkRNqn1nXzyMyeA3V6w+S+DsGzABLhYzLsJlz7LFy RdOoghwJLFhPkrtCNXazruzYCrFwtRZjtTmvl1dknwLeo9Z+RynOMbZjVukdNA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:19 +0200 Message-ID: <20240526235230.2876318-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value 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: ddwJGWHh7vC/ Fixes: The warnings from CID1598553 Uninitialized scalar variable Passing partly initialized structs is ugly and asking for hard to reproduce bugs, I do not know if this actually fixes a bug or just avoids the uninitialized fields Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/qsv.c | 2 +- libavutil/hwcontext_qsv.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 6bbfe2a5a95..0c6fbd0dc09 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -496,7 +496,7 @@ static int qsv_new_mfx_loader(AVCodecContext *avctx, mfxStatus sts; mfxLoader loader = NULL; mfxConfig cfg; - mfxVariant impl_value; + mfxVariant impl_value = {0}; loader = MFXLoad(); if (!loader) { diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index f3d919daea1..7cec3474786 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -839,7 +839,7 @@ static int qsv_d3d11_update_config(void *ctx, mfxHDL handle, mfxConfig cfg) IDXGIDevice *pDXGIDevice = NULL; HRESULT hr; ID3D11Device *device = handle; - mfxVariant impl_value; + mfxVariant impl_value = {0}; hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void**)&pDXGIDevice); if (SUCCEEDED(hr)) { @@ -913,7 +913,7 @@ static int qsv_d3d9_update_config(void *ctx, mfxHDL handle, mfxConfig cfg) LUID luid; D3DDEVICE_CREATION_PARAMETERS params; HRESULT hr; - mfxVariant impl_value; + mfxVariant impl_value = {0}; hr = IDirect3DDeviceManager9_OpenDeviceHandle(devmgr, &device_handle); if (FAILED(hr)) { @@ -995,7 +995,7 @@ static int qsv_va_update_config(void *ctx, mfxHDL handle, mfxConfig cfg) VADisplayAttribute attr = { .type = VADisplayPCIID, }; - mfxVariant impl_value; + mfxVariant impl_value = {0}; vas = vaGetDisplayAttributes(dpy, &attr, 1); if (vas == VA_STATUS_SUCCESS && attr.flags != VA_DISPLAY_ATTRIB_NOT_SUPPORTED) { @@ -1036,7 +1036,7 @@ static int qsv_new_mfx_loader(void *ctx, mfxStatus sts; mfxLoader loader = NULL; mfxConfig cfg; - mfxVariant impl_value; + mfxVariant impl_value = {0}; *ploader = NULL; loader = MFXLoad(); From patchwork Sun May 26 23:52: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: 49287 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958848vqf; Sun, 26 May 2024 16:54:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWF/QzsHrS+JnyatJQVfa/I6PKZhFVKLqyufvkEuhKSPBiLUrp9cjkAjiQFwwMb8rkW3FGZoczjr9ikI2BogmLqJvnphLBGYLb3bw== X-Google-Smtp-Source: AGHT+IE95+dmozvbCQg8lSw6zL/z1L7/b1JsNf4hduvfNSmqrlVHcZZ8fzx8gtIBkQVnAviTqJeM X-Received: by 2002:a05:600c:3586:b0:41f:e10f:88b1 with SMTP id 5b1f17b1804b1-42108a99f18mr74757405e9.27.1716767653477; Sun, 26 May 2024 16:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767653; cv=none; d=google.com; s=arc-20160816; b=NQRCeLw+HBqsEOFBM6zSudq7yR/Sv7Gu1EsN04KXoWjCiYmPBA34SMPVio55tTVPyF PgNqPcEPYMUXD+AUQCakUzbs4vYEaoNW7TU3gxvO5Df68M95p9Lk5lPE6G7QwD+VELvN 3J5H+jYItMAR65/rOaJUDePO6HcwlIE3NRAUExn47bEjwIzV6O0GGzMnaQ+5GMuAAM8l X+KKTobfGMINOX0RxzRzDwFLwFBoik8P9LvptPeVPemhZOx1HvpAhkgrKzvei1glZtcf xqv6cyG3J755bZcVhWhybnVLaQtXG6n6dCgfiok0wGTCLs5dkYdBKbIpHv1l31/INMDM OZCA== 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=UHjxtHoZ/VNYhHlWzi1pWeC0N/dZ3pwJM8vLB9J9jUY=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=AEPOAy9FlaYt8LGXX8M4j17hk5kzKOmivuqBSiX57WIGTaw8DIyYA+GsJozDEeJOVr t/tLE6ruihFunGkUGzf4GsnaX1azNNv2lixeVqgWgGDpSSLOVKGbeQ9vz/UJ6XykUZzd O8ifY7+dA9R76x7z7MTmCtnfhEVAP8WCJi3C7DFlp70O7L9iZo/gTfh2KmCCwvN4/TtQ gwvmyfhea8h1WJr7XxgmnZDjcD3TrXxd+PDj6tgvBYsxLcz/vcsGywS+iz5KK8HzAEFW ZJg99pOPYUqjR3j3XQK8Ncov1wGO3lHIcFuh8t36RzEwxmjhvuqbk+hqUqWQIhB7kVxm D4FA==; 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=bjfFM88E; 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 a640c23a62f3a-a62892fd87dsi268722266b.759.2024.05.26.16.54.12; Sun, 26 May 2024 16:54:13 -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=bjfFM88E; 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 AAF6D68D1C4; Mon, 27 May 2024 02:52:52 +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 A057B68D560 for ; Mon, 27 May 2024 02:52:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 02A2BE0003 for ; Sun, 26 May 2024 23:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767558; 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=C8WfrN4t85X9q39oZzdoAJine5Th0U7ukZV9c43y6D8=; b=bjfFM88EYYwyzA0iw2Oa/mDa9KrZ0SZSSsyR4BOwj6PBVSh3VJIDK/yI9G77u9UYdbuCV7 zB21GghR7aWFXVBeq6xuUw21o6W61Om96GtYH9XAkw+5gIAuRq6n9kd2eOcvAgkyWjJoLW 6l8u8/1y5Cg6i4kYFiixlUUdvsVqFTgVGKck6xTXjHTrsfovWdt+fzMxOq2xFwIWa9lGap BF+Ynp2xNpv+ZiPppYauL3RWO5bO/DogreEmmF0SALtHMhDhXrXQLt+Zo2GO2jJkzuu4bi PU3pc0gFklR7OZCDBAjFhhHMR1+z4UkebULHLjX14bGkbRb05e6A0asRX56T7Q== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:20 +0200 Message-ID: <20240526235230.2876318-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init 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: V+nqiQFbEFk5 Fixes: CID1598556 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vp8.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 8e91613068a..3e1f67172ae 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -247,7 +247,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7) return AVERROR(ENOMEM); } #if HAVE_THREADS - pthread_mutex_init(&s->thread_data[i].lock, NULL); + ret = pthread_mutex_init(&s->thread_data[i].lock, NULL); + if (ret) { + free_buffers(s); + return AVERROR(ret); + } pthread_cond_init(&s->thread_data[i].cond, NULL); #endif } From patchwork Sun May 26 23:52: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: 49289 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958940vqf; Sun, 26 May 2024 16:54:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX9WA3O1doCZsyg/R/6iuwOr7lTmyC+4c9B0X3Li5ViJcqn51pzPn0F9GlM9poP8WEkjzACDSIVJtyxa4Cr5rzRJUZyHOhYwlMvYg== X-Google-Smtp-Source: AGHT+IGrSHOAYzsfqVdl5nhI29cSKt6wHt0tqgWdQFfIii/ghqWe37h7rjcWVKCyomnME0GhmyZ9 X-Received: by 2002:a05:600c:19ca:b0:41a:3b7e:2235 with SMTP id 5b1f17b1804b1-421089b1b42mr59515225e9.5.1716767670512; Sun, 26 May 2024 16:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767670; cv=none; d=google.com; s=arc-20160816; b=BWZf6cSUvC/gxXAWx5a7H4oD946lK8gKf8BXpoPBvgFDQlmZuxlmFZ2ZfLUeRu4vmG tuowFfOobgq2k/Jac4lvxRKYyHBCEY7UYNy/8uhSB/jLgmSDb1ymNfP+9KjhgUEZPmzt BikES2feVRTGdmY5fcXYPyckDPJQFxjR+JQ2V3dqP5IvmvWWcj0FF+G1rBUTbFSw6OZ3 sI4yB9bteWvOGFWQoJTMZUhHSgwBJYv401xP0l0g86Dqloi9xhJ3NruBIqRA2BoIQTZc ymw9w6H74LfeYIT+hHWvZg+EHucBKZGPgVqwN3Cm+QRcoXk05cLcETcT8UI0nvhQEPna W05Q== 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=FrArkYVFhkOju9KdcKk/1/u6jyZ1BpPa6QSkRlK8YoY=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=JNf1N9pv2fk/02hP0sEHgdhucMr53ALoq8bTvwNLooijecS60gncBBUjikS0hBc2XS BETGdfxl3JmSECznP9fQNLQHurulC4nhjTQMlxJpzilOlFxM3JqCoRkt1uTMPuK2gxPk bOT6+diXGtet8+pRh0U5Ym/ecZB6GGr17dtgMppIqnvbFCCIAk5ZFuH+9iBL8o7a3hU/ zShRMdXfAiFWpLIRv236rygLlZNO/c8wj1WBCX3FqLzG+Ugk+YiiCipMdYCmIKq81Wwl 75u5oMIxfnFk9lpdnJEP3U/EGvRh//NHSUv+1nbjqxx9Wo1sL5n3Vucxf4fnYKpwnKrx 9Zdw==; 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=QluydzoS; 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 a640c23a62f3a-a626cc372c0si332435866b.290.2024.05.26.16.54.30; Sun, 26 May 2024 16:54:30 -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=QluydzoS; 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 D6B1768D5D3; Mon, 27 May 2024 02:52:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 57FBF68D504 for ; Mon, 27 May 2024 02:52:39 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id AB1401BF206 for ; Sun, 26 May 2024 23:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767558; 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=2yQh9/q/kkKbZDA7jIeCQQmVhEkwiSH0Xl34sBjsMww=; b=QluydzoSSZ+9P8xHZpyKAc/Fb3GCvXwmtWZ6bNZ5A2JYHg2RrBcmJSK2RjTDb2DeFl4DeU CoOgrsmaAKvWm8fjsuUJ39TKANh+cUNl0tcz58JjW93CWm/4O2r3XPoO+oLDUMEi9kd0VP D1uuaIGf9XCGILoQ5S8cl1mailkoRocmi7Nh0M8Q1OM7lFf1v0wofOnvNw+ghn4Qgq+CWH wR/cL78E0bFHF26hMcAIqbsZAx41WLEciJM2NEzR8EHD5YKmcSBwdvddJm8dD90a1FRk7g C9e5/HrdEcStZM5BNvkFnpF1/WHS+CBXBOij/GlG6YtqAHtQN3e/fR0Mfco4pA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:21 +0200 Message-ID: <20240526235230.2876318-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 09/17] avcodec/vp8: Check cond init 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: Ylpgx6Rx7wmY Fixes: CID1598563 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vp8.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 3e1f67172ae..d6df018655c 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -252,7 +252,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7) free_buffers(s); return AVERROR(ret); } - pthread_cond_init(&s->thread_data[i].cond, NULL); + ret = pthread_cond_init(&s->thread_data[i].cond, NULL); + if (ret) { + free_buffers(s); + return AVERROR(ret); + } #endif } From patchwork Sun May 26 23:52: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: 49283 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2959057vqf; Sun, 26 May 2024 16:54:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVxsmxs7337UtlEdi1vswfD/cPiMZRX5bMhyL1q3zRfKcjMHtuOYtJqy/9XavjV1bUUzW+i9ak8axXoPYlP+EUSXLFHTH85BKqpZw== X-Google-Smtp-Source: AGHT+IF0kVZw1GuQPKiTV5mXWs5UuTuGyg/7L4K6pRkH9V7ZU9tPxTanh3Yj25Y2eQ8AT4p9w6Xo X-Received: by 2002:a17:906:f889:b0:a59:a9c0:57e6 with SMTP id a640c23a62f3a-a6265157bfamr754734566b.75.1716767694864; Sun, 26 May 2024 16:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767694; cv=none; d=google.com; s=arc-20160816; b=zzNDgVqDUh1U5kE6jvY0eJVNhBGuTDHXcCg1LDtRmWBaW+GNNgWYSh/g8IVAu+R45E uOoxb7Pa5UvlvErBPaiLJbRAYwj/tVf1vrYsOXejHu1QJE0qe4mSbPly0gb/CX4tsCtr XLfJjJEYtjiFrlg2BV3wJBiW4AMvv2OVfDzTbo5mxfnL7HiK5BFqqMfrjJSdtSLTZmu+ AGurLu04/xvT4qmDjh5jrd/VtIZ3Bdl0I7BJ+gMrL58bbs6TT+siqHCnHwTcv2Z62ocE 22yLYQxDFFT2Qo70HwEoCJfQoLo/Y416Co40NgOQBQI8f3fy0GKiwl98Vx5gUA2zSv8T knhQ== 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=/B9RhQxe8MNEk8gXSFWFN4koorYW2gLN64kJnVaaxqE=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=cIa+g5TcEAi7eo8nixvydgwaMfUSdB1UWPFyT8rfg1wsF8L5f3b81QcLq9dyZczG8Q vdJWvU9lIcUuP2If00mXWMXu9OuTKoVKIGSukMYh8cmGpbqelrb3LCrsyWy/FYcwRBqY yUaWqM/Kv8UUYONRGO+CuBIud3GM0UQopRpxyhNlV33sIt8wFvy9EbZrUZOS14XHsbGB NktTLpY7lU0kDbXNrYYhIFEjz+tEkuIIGrWP0yeinaVwZY61ZGaIJoRfMYjvuwYZeb2e nUFzpkeRExkZkRMCK3E98QDd49B2nzqmaCYITGP2XqoZq8+w/5zJcWZzhF8lEZFGUrIv TBQA==; 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=XaIR7jIU; 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 a640c23a62f3a-a626cd92c36si324005466b.801.2024.05.26.16.54.54; Sun, 26 May 2024 16:54:54 -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=XaIR7jIU; 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 8251468D5EE; Mon, 27 May 2024 02:52:58 +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 8813768D598 for ; Mon, 27 May 2024 02:52:40 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BE8B540002 for ; Sun, 26 May 2024 23:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767559; 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=AkdJhyXhu7loYsAHA4744wMfU4NbjuVsAAPtcaP1d4s=; b=XaIR7jIUIP3ySQo0bJNmgU7+9MCV6z3xm3X4rW/Zw+UHF7cyOWsZrUP7WZY3x3tiX4RRLs JbDoKUPcblrdUZDbNKLJXEfjvYceA9FuKbv5gdQjDvcA/pFjKAdjqPURf5MlQA7ksON9jr r3AOvmyJ+MPoYPxl8iCLKyfSIdsMLo96put5Ve13uOOLN7724TyWDQIzKQfWC7lG8NwAYT w1hNWaOGWF1sSEeYwgh38LKNk/uNbj65I9rSkY4cfGJ7h0EXwqQHr9SjNOeWqN74FMIaJi OsBilfZEifOXlZg/q7ON51q9Ktrx1uptP+ugKLc9hW71GeMd0Ixz31O0wctbug== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:22 +0200 Message-ID: <20240526235230.2876318-10-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 10/17] avdevice/dshow: Remove NULL check on pin 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: DZUW/SFmxMyO The pointer is used before the check Fixes: CID1591884 Dereference before null check Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 0330d1d0b6c..8942c0c499a 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -432,8 +432,8 @@ dshow_get_device_media_types(AVFormatContext *avctx, enum dshowDeviceType devtyp IEnumMediaTypes_Release(types); if (p) IKsPropertySet_Release(p); - if (pin) - IPin_Release(pin); + + IPin_Release(pin); } IEnumPins_Release(pins); From patchwork Sun May 26 23:52: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: 49280 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958703vqf; Sun, 26 May 2024 16:53:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOcPnSTLQXCoHuMpqbDeZ0HeyoCT49VBMyklKAxFY6VJXW8UDTkdg5k7a0JgoAU7LmI8SB+DGLyDICz3/JlUvo9cRKmV+zV0Kf5Q== X-Google-Smtp-Source: AGHT+IG03/ukJbjMK+Li/bsSBBd1P7yRa0DgV5w9Lri/0XFPdzrA0Z6fmpp7nFfG2G4xwxLI3UBO X-Received: by 2002:a05:600c:63d5:b0:417:fbc2:caf8 with SMTP id 5b1f17b1804b1-42108a7a3c0mr58553085e9.23.1716767610653; Sun, 26 May 2024 16:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767610; cv=none; d=google.com; s=arc-20160816; b=lMZvedGlZj0+Yk6k6enATP+vG/jFYNPU5FP7ut0ZOJKAlgfXea7Z5a9/1xKstnuKJ2 BJ4mbFsk4JhfqLDJlhdmnG4lcd4fUjpCIlP9ca7Jy4WLYunGObUbLOsTE+Lx5hmkmEt6 SjnSHs565DRR7cfyV+habo4RSePTLkiVWMKNTqFKxwWr1PLegpNTYejQVFeqzx23usms pUmDfZSG/4uKF9BlBV+1/s1k90p2tsgcEnjyoiFFM3sguEfGMAIvzsxEdPHclRi3H9Dx 6mncLSkKNzV4A+S+h4+ig2fE9eVYexoPClNNfXMHPRobx08etY3NZqg2mmzUXKgbDKpD PlWw== 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=yFTKkA/g2mRQwqGOh6eZUGak0rZ8opeaXO9WZLIQ3qc=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=JibtEYk8vrFkamAGF2qz6EuWZTicaqJS/QTx+Y8Q5gLmPeNEj/qknKENkdX7tecQsp O2JsVhg85Nr3Y1Vytf0+L3DCTWX+0c7lSsMzMeg4vFKLgcaCr/NU9LWJsUiUjXSb1ey2 NN4zevhDyZWP46afcsEIIJ4V5ESGq8mLFb33aWQlXgWave+ih3qZoBIS7Zus8Bdlui7T 0xKixN8sepXW3mf/wMMudR2BrADMx8coKQgeqJQMSuefTu4Ir2DAxsZUj0gAr/PkbGFe pcvhC0Byflft4nBvzowuOUoCzSbzmx32lqXq196bUUaAbdYPLT0+MJv80F9mJmhXMcZp HCSg==; 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=NeWA7Rl6; 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 4fb4d7f45d1cf-579c5c95d4fsi1392494a12.459.2024.05.26.16.53.30; Sun, 26 May 2024 16:53:30 -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=NeWA7Rl6; 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 6EA3E68D5AB; Mon, 27 May 2024 02:52:46 +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 E5B7768D52C for ; Mon, 27 May 2024 02:52:41 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C477CFF802 for ; Sun, 26 May 2024 23:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767560; 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=uB48CN5yVWA0ofHEjwbNSHBN1OvJk80CNNTSuLLIggY=; b=NeWA7Rl6jgDezwHvF3INz88iPcZMWngxfFak0a6HTYRL4KHyOt3YYh/Aem+zK6maxJ+7O6 A0M3vaAHRGI9X5ReR8qX0gn/TGWA7m+Jhw8uBvaQISD+NrscbCnnO0x7mfE55AIllb8Wwz LXwwMBvVuYfNRlRWlbRwyVRPsp+1EGI93YKWfIkxRBndZWyiuMGeUKVFfAIx9RJForEsfH ZW5WeKi1MsPE+MZgPfzhVgJZqwuFhNifqtL/IOzaD3H7mofC5neG83QT0LcZ7nKBy8mn/j QTcZGC8fd/FjuZG9uO+1gWdg+5Fj3axPISBCoM3NgtqxgG9UCyPJcmSFtSlqRA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:23 +0200 Message-ID: <20240526235230.2876318-11-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 11/17] avdevice/dshow: fix badly indented line 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: H6nwZpfuMSiC Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 8942c0c499a..fd9027b1787 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1370,7 +1370,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, goto error; } } - if (ctx->device_filter[otherDevType]) { + if (ctx->device_filter[otherDevType]) { // avoid adding add two instances of the same device to the graph, one for video, one for audio // a few devices don't support this (could also do this check earlier to avoid double crossbars, etc. but they seem OK) if (strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) { From patchwork Sun May 26 23:52: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: 49284 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958772vqf; Sun, 26 May 2024 16:53:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXjG0rm03FMxKXUb2p9pqs0MBQ+FnKLYuZQKHSh1xYZ/xCk3xo2+IYV+yo3dYV6hIpq6zQ6nvul11PSiQO9cqW0d3nriejb0kgpFw== X-Google-Smtp-Source: AGHT+IGbm/K2PUMOiRvDWN0paqE4kolQZfszzNryZJMC/TN2Uau/bDsDeYb3eSYFoCtaU7z7wQmJ X-Received: by 2002:a17:906:35d8:b0:a5a:5c98:c595 with SMTP id a640c23a62f3a-a626511a554mr874879266b.61.1716767627900; Sun, 26 May 2024 16:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767627; cv=none; d=google.com; s=arc-20160816; b=xjX/RMy2nTOR4MzdRXEtR21Xof9ZeJbiytesywx9gZZEegz6Ryfl2jNGOiwUbnTg9y VmDWoFi2+4bZEnFBTovfa2dKLxUtxxlLvNg0gzMmsuHPDBOXq6cwmf6+Ew3GeG8mX69S v/AyFlNRO9cP4/kk1m5XBYdk/INeW/0YPM+Ke2lJy5atlOgbFY1pUSn1LA7Wx3GbAoBJ HY2BuTE8IFJ8iu13kOBDh2Dn2m8dffriseimUeL1CtzI39OLrrQbG56K2+nT+rMcVyUT VDl5QgVc+X96Ciy6u+Ew8yyPP0VlU22O4WbJokvSBN+5vsQNlqw94eDi54qwAkJA7IMz /i2Q== 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=K8PgzxMdxMVABxf3TtIjlrGgQ2i0hQZMhcZ90ac/Kz0=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=M8aORfampKESvTM25QAoDKklFnPgK2qkesAUu4swu4dkoMl6HgYdiQ0OYQJqyX+Gi9 UArF69cWXqSVTvqQ356JTNOd1P6CwkhsAhKM2WzsHNupAnDYsrCPWEBeyn4p/5/rbhbv 82oXr7nMBORSyZqlqnz3yIhEJ4haGrBQGvOHNYJ6xzoGENyuWKXS0WXZJDIrgdrOCd1f R8LuadeFdWB9sdvHEqqS+DVCkelztd+YpbJ9y+/sJ7lXqHfiXqzdMSIuhM/WVfD6MIDr 9udsjsyUncNgCQE8aUIE5yc7IkDGJRz41dxhKmS6VwdtaBcy29XxqWAFZe1BcmV+U+Is NYYw==; 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=Ey7uKPVc; 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 a640c23a62f3a-a62b9424badsi186586766b.636.2024.05.26.16.53.47; Sun, 26 May 2024 16:53:47 -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=Ey7uKPVc; 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 24D2868D5B5; Mon, 27 May 2024 02:52:49 +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 5868A68D542 for ; Mon, 27 May 2024 02:52:42 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8C5E720004 for ; Sun, 26 May 2024 23:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767561; 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=7ZK32Gw31Yjt8tf8k8l4uegmqHnX32xHC9wbx7xKzFY=; b=Ey7uKPVcSEAFHbsyJUU0ZLTUy4GnAerotAlKEomfwzvgJpcnhK0mjvb2WSIqJgpRj1dcp0 OFYZ9IwhKaGYrLWXyb9ZnRZ9GYA5Ewn+lVNf2sIkezp/9e5E7cPLSSFUwOjP74JRhLYyQt BIJY2Mi/xdgcmI/jwwhnnI+hLxJNNn/cEe5LokfCh5THUEEprv3Qk6X7b6VVe0iBnnLozg 8B003gegWTSxxEN6nlhn8NlgDBqUEcsfadSOdu+fONa6MqXBGF5CdUTl4Xj1RSEf7wP/MO phxjMlSxxo0OHOM/Nku19EINahzFIhTbNA2vf7gWEDrd6IqQkFXSldvFUdfd8w== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:24 +0200 Message-ID: <20240526235230.2876318-12-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 12/17] avdevice/dshow: Check device_filter_unique_name before use 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: zzx5wVYooHin Fixes: CID1591931 Explicit null dereferenced Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index fd9027b1787..911b0ecc078 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1373,7 +1373,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, if (ctx->device_filter[otherDevType]) { // avoid adding add two instances of the same device to the graph, one for video, one for audio // a few devices don't support this (could also do this check earlier to avoid double crossbars, etc. but they seem OK) - if (strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) { + if (!device_filter_unique_name || strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) { av_log(avctx, AV_LOG_DEBUG, "reusing previous graph capture filter... %s\n", device_filter_unique_name); IBaseFilter_Release(device_filter); device_filter = ctx->device_filter[otherDevType]; From patchwork Sun May 26 23:52:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49286 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958822vqf; Sun, 26 May 2024 16:54:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXuNbnFH4B4byujP1M/8Pm2hZm88xUIeVL0HrTFdZ+5ZuFAQK6yOgozV/wjX4q1GX4afQFu6BUdhGgq9QIFfG1Ix2A7F9znA06ABw== X-Google-Smtp-Source: AGHT+IE0blfwWIs5oK6IHgWftfRPHtwLJAgMX1o4cZLe5nB8HPuRvwqD5phVZPz4LCpBh2SsON8X X-Received: by 2002:a05:600c:6b04:b0:41f:e7ac:cc72 with SMTP id 5b1f17b1804b1-421089f9a09mr56201395e9.40.1716767644762; Sun, 26 May 2024 16:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767644; cv=none; d=google.com; s=arc-20160816; b=lbBM/j/cM4OYTLFEkwHJNVEZOhVvid1k9xSNjOuSboFINXIVcLtDZqYirYT8BzzG6i Gp09xzQurP1jBDBzg5cmu/eR4NozCTRMHUV8ZQjcIcAPIJ2D+VuSzctFGSsz/WV2FD/M i+cA/4M25z9MSHPi8Ju/r8cz/6a1znP4tjeIhC/FH6MrfGgCCeWxRL92WNRSFfD8CTI7 WDr3BGmEbUu4WrFF/vHJDJ8bMrUahnr9eIV2rbbplIf6etSJDW7L+VIKNvQLxkGWyh67 vFucwZXsrrmfLgcMVB8CLqeCEdMCl7kKiKh5Eplv7UhSrJa8QapgewkBOBwXuB5ijaLr Vlzg== 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=CB4qiIfTCZ6SfjA77ZjuoTMYngI00bSu0T1MDzk1J9I=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=J4IHwk6Y1V4yOreMdHn3x5AVpWeXxEkPQnWb+9F4Qv+ePb6p0sqwdxZX5w707Ajau1 Sn1u5KVg5FiG7j3VBipg7vRjRR8MO514fu94R3UG5vk5b5vVItOBQDiTNSZn7tJNOdAo jLmx2ITYCw9i6h/WvET6Y42coxjaOEy1VlipA9ZzjNe85a8n3Mb3rPZi5pfL71ryVqpj SI/TE1mRtKCaZDTwoBW24g8M7VU+4gk/ulicQF+eJrRCPQgmI/6OqaSEQZ+OcjtDf2u2 UoVT4tvCJMDdUBy2j/e3ezovf0rKtFbjkzHceZd8EFuv6BMnYeTstpNhgIOwn+o61tMF /rlA==; 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=Gz5BqQJi; 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 a640c23a62f3a-a626c801234si329137866b.119.2024.05.26.16.54.04; Sun, 26 May 2024 16:54: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=@niedermayer.cc header.s=gm1 header.b=Gz5BqQJi; 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 AB72968D5BE; Mon, 27 May 2024 02:52:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8B4AF68D1C4 for ; Mon, 27 May 2024 02:52:43 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7961D1C0002 for ; Sun, 26 May 2024 23:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767562; 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=PMu+pXVwkJ28lIe9LqEyDSiEYWV0LDKZMmSs2LDyeoc=; b=Gz5BqQJiUbUcBvUnYMp36XiKonz3BnOtF8pE04/13+WgzO6YD9ncdJLK2HNMabO8WDaecd cmgz+BeFAkx96dV8IRnJ/PUgXdtHbYAl9DfiKAUUIrhAQl0a96NfA86/eMjMtOjN14rYbi hPYFPF2g7mTuKTUdUOQ7b8E6a0DrbkHn7R2K2gzbEHQR6mU0boPw+ZeINGHgcfvNwc1COR 8kYkDz+nq6gGj1r6KyzpDnxsjfZkQm04HYC5xMfuFvNXrwHyY1Rkd7RcWzi+BcjiIe21g4 iGTC+p1lF4irgOZ9aFKAM2QYNCRdjQe3y4QpMQkTS+1564w7Zc6s+p+7GuYT9Q== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:25 +0200 Message-ID: <20240526235230.2876318-13-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 13/17] avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure 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: WNH4d9EOm+L8 Fixes: CID1591939 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 911b0ecc078..557cf33161e 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1465,7 +1465,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, av_log(avctx, AV_LOG_ERROR, "Could not create CaptureGraphBuilder2\n"); goto error; } - ICaptureGraphBuilder2_SetFiltergraph(graph_builder2, graph); + r = ICaptureGraphBuilder2_SetFiltergraph(graph_builder2, graph); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not set graph for CaptureGraphBuilder2\n"); goto error; From patchwork Sun May 26 23:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49288 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958890vqf; Sun, 26 May 2024 16:54:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXAZZQlmNLcgtEZm2k0/jjkSBnRtHl5HQcfK0ji+9Ty0tZLelucPLucOcD02tE7/XL7XUbv+OQl/7OMmZAbBSApT05UCKkH7M4+pQ== X-Google-Smtp-Source: AGHT+IE2gGRxQXNBcM9h6GSGncEEXDIq/NvUgy3+JyKUZ69bVow0URTGnF8IYyK+dxiHSyNHG+2F X-Received: by 2002:a17:906:24ca:b0:a5c:3072:5084 with SMTP id a640c23a62f3a-a6264f0ef6emr524177266b.59.1716767662008; Sun, 26 May 2024 16:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767661; cv=none; d=google.com; s=arc-20160816; b=MzuAPxOgmUurDQ0nH2GEoSJ/lSEZYUzStNK+RtoY62UKQFFJj9lBW2tnUC7Z2n1D2c O5v2pMJgomav0rPhJiSHQvd8iO3m73W6E7EfmdNbUcQ2BlLTSkevhdgk0i6BN/hLCs0d La5X+fxmu5l4PAKgJUidSfJOesd49Ji9rcIJ1plvknZEy5v3txUwRqVGj+1YhKfbrZOy Ag657S1iac46SmVVi+Fe58wIJYILScMKsqOxlLBomyR21csYqWxGzcJegMZTu2ieCS+S pptZlQV0U51eil0/SYW/NtNxlbJtdD1iQBBClivkPaLqhNuzunSF4mk6b02OmOj+oTid 80ng== 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=KlVXasPzYQC73cBv2JjI4+mjz9C+UjHfXbM4AoOLg6I=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=bdZFrhIfPLRY8Wc7Rducni6Fto1ll15I4KnrGEgqU12eNH6QJjJYjpofRGz+Dz14kv d2EpXLW+rYL78FRrVAyVcARnlHiSmhxJL1nUuq3Y7lBdo4WdhJswUjsYWISN8QbSYJTO Bau8H7gi+frVizsFoslM/LqzT4K+GTGoNA9VHo5K2+IqPqa2q8e7SXvgk4hrPnJkygKv qVLgmyjFv8qgxfCOVV48WvBlncegKrHrW3HSM/MU9VWvjoQXBYfKRadT8mm4k5jnSNh9 ITsV/RSBb08klVNEbqvKuZfNjO70lxVjx59zXdYd1Cs1JmQnJgIf+vlOzHnreWp26xdL eXcA==; 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=mW6swurg; 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 a640c23a62f3a-a626c800867si320484166b.94.2024.05.26.16.54.21; Sun, 26 May 2024 16:54:21 -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=mW6swurg; 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 DBBB868D547; Mon, 27 May 2024 02:52:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01AEF68D560 for ; Mon, 27 May 2024 02:52:43 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3DB47C0002 for ; Sun, 26 May 2024 23:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767563; 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=s1FN21pqsInNyls2oTtG/cDOoU0UXvemfd4Op5m2hlU=; b=mW6swurgewOk+TndV3dfOaoUqumXIPNmTZixnfFZbUYhL0E5SFw9uQ0FUeDjOi3eRZMxxH VUIJDNfVe0WKmOb8VaJge52yUssEkaO2pl/zoUqeLSdNd7+tygxSadXi/ivT63UD34OXNc 2qkN4gGdFrliLLk9OIVD4qj+gcykcViltVOHU7gi1NJdLlD4Yw6/cLXwQhvCS5SVl9HrkW nl/8mPHq6l5ODBHBwo9D1mszWulb+MZ0DYIpSm2XEB0F7Kcby0Z2JjJxEP358Q1By7iw6R jbi3x8QgR/UxMAMPi/zi0yBTLvDyHE2xbEFiTyL2ChHGiuNXaZLOxXKyXGwlAA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:26 +0200 Message-ID: <20240526235230.2876318-14-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 14/17] avdevice/dshow: Cleanup also on av_log case 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: u+rVHmnlX4cg Fixes: CID1598550 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 557cf33161e..645c33ea2e6 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1001,7 +1001,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, " ch=%2u, bits=%2u, rate=%6lu\n", fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec ); - continue; + goto next; } if ( (requested_sample_rate && requested_sample_rate != fx->nSamplesPerSec) || From patchwork Sun May 26 23:52:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49290 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2958975vqf; Sun, 26 May 2024 16:54:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUo1sKZPGsJmKGbgpMMz39neWDCnHnAJlX7cmu4kJoZ13Mtgd9pyMuMEpPvuZGuIY+kcjn4AqrfN6BQoBbNlyC39DjmvIy/v0lGtg== X-Google-Smtp-Source: AGHT+IHjB3H3b2RMSY5s2BtVvCFD/95FVcWl3HN2RXGyqlCzzRpXRnapmxBDSioPNB+1VtMi/APV X-Received: by 2002:a17:906:5654:b0:a61:9d64:e79d with SMTP id a640c23a62f3a-a62642decf2mr610819266b.36.1716767678405; Sun, 26 May 2024 16:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767678; cv=none; d=google.com; s=arc-20160816; b=YhAiX/D9LBV6Xjp2JDroslhIvtsFXDgtSjxM0EjyqIFU1LLHEXrrZHob3PrATKgCvP TJP7J7aaiOWFJ/yO+zwHk0wTKIs9cSdwTtw4Sgkt/wsrfCXbZBoOTrRJIeNGAaF2iNFb Dn79JXpluSvumSxDFGNtUyGKBuYxXUKj5yKPnkevgDn/tvKJJVc2TkDDNkcZb37Iap01 mggVjpFGG3fpe28twdhftMM3EHQQhNvOGR6J5slxFFKLjH210AWXduKIZDNILs6vwHeI 5wVywhPu2EblLaFpm8fXsI1LGUBihLFT1h+6znDvIegJGL35vA6goRcj8/lWwBM//7PC uACg== 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=0HfyjAxTLSy8vCQOycquEScrYmgLqiFt7EqyksSJ0Kw=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=wht9yDoYCm+y5BdTkic0kX4giQZB71v+VRCoOOj3qO7kc7hq3vD4absjX4lE0Zbbcb Pyp0Hx0R6SRu31Txc/sANfxaAUMO8GOMRA6lYG5zDIaONDJeJrSMaAcfG3oOwyqjsIl0 lUnIxoSEDlFyyHNkbQQ2MJYv2IA2cm7EuUVOifmhwj1LjZ189uTWvQG2TLYX0vci+Z7D /8ESYUWwxPVRdYYRbcl1kx1zw8a4/JC1OGTod1aweyzlGckI3QyDIk8BS+kvdPPnMaKJ RKuWs7bHwomrUwVpSDdXwCJ5dejMHkPA2RRITXKSaGCtIRpj1z0dLWYmmEYr+B+EyIU/ BydA==; 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=pDaVuZ2A; 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 a640c23a62f3a-a626c800e2fsi327190566b.87.2024.05.26.16.54.38; Sun, 26 May 2024 16:54:38 -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=pDaVuZ2A; 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 C97D268D5C0; Mon, 27 May 2024 02:52:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ACBF968D590 for ; Mon, 27 May 2024 02:52:44 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E5A391BF204 for ; Sun, 26 May 2024 23:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767564; 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=dgVhXFpcn4upS6Ofev6q1EsxPrPfFy5nzDjPKntVbG0=; b=pDaVuZ2AtY8r7/4ix8dB0ouEg3JYKJP8dIfHwOH0+G5ZGk09oKfr6u6bk6hHYdoogodsVY DBCj4InEHWcRhdrbysmxaKzpmbtr5b5N3uvc2bDT/STvxEjWXcnghqBEtX3jAN8Z3qbt60 OgvPf2V0tuQs75GvtlMtl+zHZA4uIkjMrGDuz7G7uuRrs6d84apv6x7Ql9aaE7F3JJnZvk pDaikX2+6vkm47XA80XdTKfFz8wXtHptr0Ga14yspvWKKc+5+ZQecxlBhuB4+ULv9Pz7jF NFF7TFUBdeispeFL/FqQSliPcmaK2wNWuK5ZQ3l1oxwXqhbpZ2sHWL80jZt0SQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:27 +0200 Message-ID: <20240526235230.2876318-15-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 15/17] avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure 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: L+bF3PBe14+y Maybe Fixes: CID1598557 Explicit null dereferenced Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 645c33ea2e6..403e56fe135 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1546,7 +1546,10 @@ dshow_add_device(AVFormatContext *avctx, ctx->capture_filter[devtype]->stream_index = st->index; - ff_dshow_pin_ConnectionMediaType(ctx->capture_pin[devtype], &type); + if (ff_dshow_pin_ConnectionMediaType(ctx->capture_pin[devtype], &type) != S_OK) { + ret = AVERROR(EIO); + goto error; + } fmt_info = dshow_get_format_info(&type); if (!fmt_info) { ret = AVERROR(EIO); From patchwork Sun May 26 23:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49282 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2959011vqf; Sun, 26 May 2024 16:54:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVIGiFqHhT9qEt4/y2SB4Ah2IAsJtWVJVRerVXYNfQxU+Xek3bMN3CEIyD4MhHKRbL9t8T4JR8AtqVxVO+l9+ZC87Ij+4ENUKa+VQ== X-Google-Smtp-Source: AGHT+IHuE6mq9e40CVcPTXZ1CJBr7q5nwR6fypAKChtlIbZiBVINGJuRkAO7ufNltXHq8nv4Wcj/ X-Received: by 2002:a17:907:82a5:b0:a5a:3da6:7712 with SMTP id a640c23a62f3a-a6265134c8fmr429424266b.71.1716767686565; Sun, 26 May 2024 16:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767686; cv=none; d=google.com; s=arc-20160816; b=PkW5fAgGLsUTDf4fs67jjAxSo8Ahpjv5ZqXiCd2HetZQrpz8nUqQJDRVnu5TVhG1CW m2BhOW7CcMIjQKFYbSl3uA1ifjG+1+mzjdX5a7YXJCofYrwzPqFtCTorspYIxJyMFGX4 xdRoTyBPGDgjS5B0vpXF3f38wjwPqZA/kse6TkdE6A2E6S26cDSk8QatzsDT6f6/x5cR uKUw7TOfBxxGXiW5GRWOC+y5yT/XDxLvFLGWT+Je0zaM0GPjS+eS4qJFpIrXM58vGtyQ fT7iipk6+yVzLekDklNB7vIviTxeAFm2InaMsu3Az6Bwh4bAOvanZHenR34i20NcihkS 8PDw== 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=Gf4t2Yx3Pey3m2rnRm6XS75BbwqwJ9Q7JmzijXTFqXk=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=qjpXefa5129fiWuuMceIM8E8tGk3rDWcGxWyqKU/yRtujEqRxX7JVMT8cRA7iIyxqx X4mcvI9bUe8MYRO/lKL8glKiK2eurDtXKFORvYQbpLNSonLT/UMJQX+RAww71QVO4d35 dITmuskSTuWMrkcVkkaOOoAynZKn60aZS2NW7dgba5A80eZXcbzxS5JXONMt4Zn0g3Hr FvbLgYlXaiKbagpaEzYRDSNa1TgjXOebBJ2/5CSdT1p7jaGYaUphBdhTrrpoJ0el+UK7 KvLz3K/3h0qpy+o8B9PLzLSaoUOoTOjsvdyyzKganw9HFSUVFmg3zbywcDG1kZSoRL9C 5WZQ==; 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=dA1Slzf6; 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 a640c23a62f3a-a62892fd87dsi268757066b.759.2024.05.26.16.54.45; Sun, 26 May 2024 16:54:46 -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=dA1Slzf6; 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 1917568D5E3; Mon, 27 May 2024 02:52:57 +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 6792168D591 for ; Mon, 27 May 2024 02:52:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9E069240002 for ; Sun, 26 May 2024 23:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767564; 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=A8v38t965RWyqcVcGetTo9541ZuPQaRCppu4KTN5NRc=; b=dA1Slzf6RyvO/pFAorVQ+Wz2l1j9q7/YKzQNlN8pMQ7smOQ7avLVPHDsYDGizjZPScWyRt 7pm7+7rQVDV2iT3/YC3V1qC3CZZYy1vlcNevHFmjy7o7udWxtiisK2bvKc37EBKxihY2jQ OdAOWRPm5cZYambo5kIfFYbNY+CWkMRvq1oEwrX6AL1dq7+ejkcswJOWtn/8RwUdy9ZNlh 49Cc6eK3qdADD6Zg6IWG6HbhbqKPg15qOzF0TDOBdNSSADgXDq3h7LhfS+CPGaI7BPYtBa 2cDprSn7JL7L1x/XnU5FaTTsXixZAHGaFT5hOIUlnyMpXX9dqq7HK6Hx7D3l/A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:28 +0200 Message-ID: <20240526235230.2876318-16-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers 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: UvIeTtVhx83C Coverity claims these are used uninitilaized in CID1598561 Uninitialized pointer write and CID1598565 Uninitialized pointer write Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 403e56fe135..5947096cb29 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -898,8 +898,8 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, if (devtype == VideoDevice) { VIDEO_STREAM_CONFIG_CAPS *vcaps = caps; - BITMAPINFOHEADER *bih; - int64_t *fr; + BITMAPINFOHEADER *bih = NULL; + int64_t *fr = NULL; #if DSHOWDEBUG ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps); #endif From patchwork Sun May 26 23:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49291 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2959081vqf; Sun, 26 May 2024 16:55:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW87IltIA7WxVRc4frczcCdGSfal6ITjjq21uFVDvvGNeJha366crftoJ7MOOCYVbVy/ZA5skfEmTltHZbwkZ4I/8B+6dxZiheU5Q== X-Google-Smtp-Source: AGHT+IFnzzCQRWvFIKJkN4M2hbuMWqhNa7nC1OWzI2VlvsMr2Y1owDqyMPhmGthaThF6T172Efuf X-Received: by 2002:a05:600c:198e:b0:420:fe60:c387 with SMTP id 5b1f17b1804b1-42108a12ab4mr63390975e9.38.1716767703188; Sun, 26 May 2024 16:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716767703; cv=none; d=google.com; s=arc-20160816; b=wVaILwIjGkx40TE7s5ggHwLyIalKWvwGK8NpSu4yPHfG68+mIbAa8Ix7FYwF6e5uWR FxnL7VGdaUfmNihI5kx7PUCPPC7rhvFa9yCabihKOZ00VhjIulV4szvl/tiAx6UrWDF/ jo8YqWnMQG/OAD4WXSv7tN1nnJufzfH1f1iOH3qG5O47dzJyCk3s9UO99mGMQgYsowC5 LKY+qnS0WnjVcJGwdEr9K/Tme3MhHPlRBSF5CZgj42cBoTmJgAKVPBVFfKrRueI/2FXR vYZ0TE7zWSCdTu3o5Ce87qmUCfnkmnGmtarIjpfvaK2bEbXtkqTnlgCG8sciDRvFvf9Z XM0g== 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=DWITOTp2zFJecdgOi9gtP7FLb5JQoG7Pk+/4b6ff5QE=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=0QVi52hwcfTgblDka+rfXWA0IxZPdu42N0s6TluVPxNb4KGjmhxc0Vxgrblz5RkVcj VM1RTN6DWaeFJGp6l9i/9vN2PcrUbUI2WhvltFxMhmQw/opYVSTRqbHBhBF/mGUn2cYg 2oqHewC2rAKnsvB6MW7VCUZ3/gBkfQ9f7Tf2aRUxrwatFyU4wTeIQRL//dkIyk6hqm3U ts9qGR3incGQQMLc60tzYju2hwyeVIFaYPgN99nbwMKy4nzmlUHJIKOnwOkkXieC3Bhg Ct7zzl4C/HPRCFB/CLz9fleW9I8aCvLiR8tor0JPb6aLx6Q5w5w6wIg//AwpDzovsDww dgoQ==; 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="dgbLSk/M"; 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 a640c23a62f3a-a626c918c02si313621866b.249.2024.05.26.16.55.02; Sun, 26 May 2024 16:55:03 -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="dgbLSk/M"; 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 28B9768D5F1; Mon, 27 May 2024 02:53:00 +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 E33E868D591 for ; Mon, 27 May 2024 02:52:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4D4AC240003 for ; Sun, 26 May 2024 23:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716767565; 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=8JSV8jHahvWgMWcv5+JtDiOCqhbRl7A3UHYxPZVN0kI=; b=dgbLSk/M/eaDp8rBXF1f4cQ0lH3V6GANtyZeapgUtZT7hqWW9EdqaZvN2gcD36PQO24/Y8 kJRAcOabceUvIpA0PBk1Rt2qfbdh5rbl8JkEiI+qs14rbmC0OsmPYW8M88p8wgfrTEae4K T1nObgzJaKj6/v4sx3D3Vs+eUkUay7bgWlBol3/swrUASDRhARidTUVrvYsSqnn8u1aPZ7 Va5ojFWM/3+DcqlBKhCjDZE/tiWXaqX0c05VUb07UbLl+Xe1r5SqaGAjKIFfbD2X5JB1PY 0kjjYOr93NEkceYLXxgPvtqTrsvyWCxdCjW/0OM/ZUbRsvl0NhP0TUx9RitUxQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 27 May 2024 01:52:29 +0200 Message-ID: <20240526235230.2876318-17-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240526235230.2876318-1-michael@niedermayer.cc> References: <20240526235230.2876318-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 17/17] avdevice/dshow_filter: Use wcscpy_s() 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: rzP1C9rY/4W7 Fixes: CID1591929 Copy into fixed size buffer Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavdevice/dshow_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/dshow_filter.c b/libavdevice/dshow_filter.c index 4642ac077c5..2122c846262 100644 --- a/libavdevice/dshow_filter.c +++ b/libavdevice/dshow_filter.c @@ -135,7 +135,7 @@ long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *gra this->info.pGraph = graph; if (name) - wcscpy(this->info.achName, name); + wcscpy_s(this->info.achName, sizeof(this->info.achName) / sizeof(wchar_t), name); return S_OK; }