diff mbox series

[FFmpeg-devel,10/11] avcodec/aac/aacdec_usac: Avoid doing the same thing twice each iteration

Message ID 20240630231306.3779027-10-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/11] MAINTAINERS: Add Timo Rothenpieler to server admins | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 30, 2024, 11:12 p.m. UTC
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 <michael@niedermayer.cc>
 libavcodec/aac/aacdec_usac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series


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;
                     che->ch[1].ue.noise.seed = 0x10932;