From patchwork Sun Jun 30 23:12:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50229 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp1462559vqv; Sun, 30 Jun 2024 16:22:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU9IXXe9bAmwPUMrYuwzCK3bOtCiX4nLEp7BKivf+DythrzLL6ita87i8BJp6VYpncsbnpEr3+PGilw1Hvbat4ElRhzm9hKY1B4pg== X-Google-Smtp-Source: AGHT+IGzsAJZFHdr8yleSRkqlUzy1sH5UerCfaZ2JQvoXOwJzPncYi2BxUuhl7cFEOCqMqkTbvQ3 X-Received: by 2002:a50:d518:0:b0:57d:432a:582f with SMTP id 4fb4d7f45d1cf-588e4fdf8a4mr1402752a12.1.1719789772457; Sun, 30 Jun 2024 16:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719789772; cv=none; d=google.com; s=arc-20160816; b=zuKvMvTN3xfDRF/ic6Z/fUCpVXGZzya2sSR+nnTZfho8rzh6MZcoTtYQ6XMr78i5mM 06owOsZ6+nMub1qHPblqrNDPoH8nuMjAjvJnQTHr5wZLlTG5n2Bil/01FHbGwwafVuj/ +cKtJJ2mLCmxTG/qhHhVovXrwyzEr7+V4C9I5p37HbH5Nn39PjFbDG2CQq/rGqSFR2sx Zv3jwAq6nxhHXA2k4T2eDOUbyO82qnkDFT9+cM3as2zck+kSZKvViq+ykF09Y8rtizz8 TYwh3nbwLjlSMX5XJdxbfI4x57DJfj/QwZYXFDxDrvepM+dRmFCQwaptb46ubouX7Lb0 B0Pg== 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=dhgyrium4yiAqAI1EgUO95Z28qatc5a1ehVwZv4w46E=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=ziaSb7DrMr9aRIhNgAkqp5e2FPlSsQb4+wIPCEc/nbclbmcnKynj4cG7AD/6G/TlM3 nb7vG9N6uwGxdp0xx7TO3u6ZAwZrtSwK3v0Q5CPluD/QkrPglInEJ3t8XUUkqGHcUg8p MhzektBmjEtpyCxLCNFElmc0Gv8bK+HDx26rxcqJtDaR2DCeLqgzsXBnUfxpFGi4hZV/ fc3VkPeYjd8Z+irX/mw37VWNFuhongMzn7m2t3QWoeytJX1yd+dmndeoyDaIzi9ilLj7 gLY2YKgasG3oQjaaK7zu/+gnlnALK+SpueQo7QY8MTbFbK4dmcjBDW4GyRKl79ggdAql O7lg==; 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=fpdID7hS; 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-586150336c4si3399696a12.319.2024.06.30.16.22.52; Sun, 30 Jun 2024 16:22:52 -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=fpdID7hS; 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 3E6D568D753; Mon, 1 Jul 2024 02:13:40 +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 DD53968D6CB for ; Mon, 1 Jul 2024 02:13:17 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3ED6EFF802 for ; Sun, 30 Jun 2024 23:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1719789197; 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=APG9JGxC9WXlY4qAxTm5y3VqL8MX5nQD65DCIwW0dyQ=; b=fpdID7hSYS9N5bWGMJlqq017VN3JiF0iYwHXo4ygi5hX/lgH0zQ984x6cZXQMJY56TE3/k gEikNPg8/s95zADnSErtFtM0ET7BOT0XWyww18bM0vH62nBj/03N3rKqJElxIatUC3KMy0 nxhI+guEWX2etN4W8GDoPIOZoAsfwVLlrMsWwpg0z2IkbpsELU6kfjYxxD2Bu3wMGs/Yau dD0KUDkI5KqCqet+lbD4XotoGzzeJoFG2rvHUZ2ZoAhB+NY1fne22c7EtnEG/YDueKf/6B I/9jPwNzY7J3ZP2wzr0mDatdfekCftZfw4oQFQh1NEQblZwPG3azrhyx4KpbAw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 1 Jul 2024 01:12:49 +0200 Message-ID: <20240630231306.3779027-10-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240630231306.3779027-1-michael@niedermayer.cc> References: <20240630231306.3779027-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 10/11] avcodec/aac/aacdec_usac: Avoid doing the same thing twice each iteration 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: DWR5SPxAzxCK This requires review by the author of the code, i have just changed this so it looks plausible, this needs to be checked against the spec Fixes: CID1603194 Logically dead code Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/aac/aacdec_usac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index 4856c1786b7..9587348021e 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -313,12 +313,12 @@ int ff_aac_usac_reset_state(AACDecContext *ac, OutputConfiguration *oc) ff_aac_sbr_config_usac(ac, che, e); for (int j = 0; j < ch; j++) { - SingleChannelElement *sce = &che->ch[ch]; + SingleChannelElement *sce = &che->ch[j]; AACUsacElemData *ue = &sce->ue; memset(ue, 0, sizeof(*ue)); - if (!ch) + if (!j) ue->noise.seed = 0x3039; else che->ch[1].ue.noise.seed = 0x10932;