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 E0C694B4FD for ; Sun, 7 Jul 2024 18:48:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5EFF368DBF6; Sun, 7 Jul 2024 21:47:44 +0300 (EEST) 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 E8CDB68DBA1 for ; Sun, 7 Jul 2024 21:47:34 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 54F85E0006 for ; Sun, 7 Jul 2024 18:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720378054; 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=jR37XGJgjnIcivtR3hpF2C+1pOFogKk74xdDab0ms/k=; b=Z5WS5hpLNUnaV62QYBdJTZdy7ZG+U/jLAi2rAwId0KihdoleR3pE6iJ6O0Spw4STeQzDI3 jXfKXodApIy04YIGj/tIg2wDIa4HnXK2YQjYbTck1NxRcncIz0yZTJeIuBHF8i10dYMqQ3 CIyPw3jFvZX34Uy45iOQOTYiDAl7Tragt9a5Yrr0tKpWoSrxbBcQRRaXIHLCucKbwlJep4 uHUbhg3syJGvfEeHAk6FGln/oeBf+nCWX35T+UvLRjbld37KPm1KQzpn0djKc8EBRGEZFZ O2Aq2PSbL0CMOLG3mCDeIQgYSBIP+Uo29qldDfp56H5OE9KWJi9AmbYJJY79TQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 7 Jul 2024 20:47:29 +0200 Message-ID: <20240707184729.3525852-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240707184729.3525852-1-michael@niedermayer.cc> References: <20240707184729.3525852-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/6] avfilter/af_surround: Check av_channel_layout_channel_from_index() stays within the fixed array used 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: CID1516994 Out-of-bounds access Fixes: CID1516996 Out-of-bounds access Fixes: CID1516999 Out-of-bounds access Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/af_surround.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c index e37dddc3614..fab39a37ea9 100644 --- a/libavfilter/af_surround.c +++ b/libavfilter/af_surround.c @@ -269,6 +269,9 @@ static int config_output(AVFilterLink *outlink) for (int ch = 0; ch < outlink->ch_layout.nb_channels; ch++) { float iscale = 1.f; + const int chan = av_channel_layout_channel_from_index(&s->out_ch_layout, ch); + if (chan >= FF_ARRAY_ELEMS(sc_map)) + return AVERROR_PATCHWELCOME; ret = av_tx_init(&s->irdft[ch], &s->itx_fn, AV_TX_FLOAT_RDFT, 1, s->win_size, &iscale, 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".