From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EEA344B693 for ; Tue, 11 Jun 2024 13:44:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0662068D853; Tue, 11 Jun 2024 16:44:34 +0300 (EEST) 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 F0C6D68D84C for ; Tue, 11 Jun 2024 16:44:27 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2CD5B60003 for ; Tue, 11 Jun 2024 13:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718113467; 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=xpnXx+YKF87a8kf9Dsjrt3PxKAY5PCCZmJpoMLUmZ5g=; b=d1T0+elpdRN0ZtOSEkyFolJ/xe1w/nzs0ci/LDoKYgPtzXvpFqHvXBqG+C/Vx1SgUzeOQU //MFek6L5onc4w5jBRp991L4lRt6/9U+YWR8x5vmAnzfJ5u+KVmWerESorIy0OcbGpBvAT 0NAJ87Ija0/cGR7IZIL3WaEam0bw3tH5SbMD4BKKuNb9SY/j59/AP4UsY2SqFaG9aHxkrF hzQWcI3d+JfcTPD6mfVt+2UcVPK9uT+hqP9XmmKgsijde6eRW3HVHqh3vxYbMSuE55a+bg YluRI9cGlzsXRi15ALapwcc58LjpWybVyoLGkcagNtQpmdy6Vyvc4f0rcJI9nw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 11 Jun 2024 15:44:22 +0200 Message-ID: <20240611134422.3172010-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240611134422.3172010-1-michael@niedermayer.cc> References: <20240611134422.3172010-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/4] avfilter/af_pan: check nb_output_channels 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: CID1500281 Out-of-bounds write Fixes: CID1500331 Out-of-bounds write Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/af_pan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index 31c6be45c37..da32977c995 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -119,6 +119,14 @@ static av_cold int init(AVFilterContext *ctx) if (ret < 0) goto fail; + if (pan->nb_output_channels > MAX_CHANNELS) { + av_log(ctx, AV_LOG_ERROR, + "af_pan supports a maximum of %d channels. " + "Feel free to ask for a higher limit.\n", MAX_CHANNELS); + ret = AVERROR_PATCHWELCOME; + goto fail; + } + /* parse channel specifications */ while ((arg = arg0 = av_strtok(NULL, "|", &tokenizer))) { int used_in_ch[MAX_CHANNELS] = {0}; -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".