From acaba8d7f2abff213b48e7ae5ea2c8134dedaade Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 13 Oct 2026 05:45:22 +0200 Subject: [PATCH] avcodec/aac/aacdec_usac: map USAC channel elements from the UsacConfig only Fixes: th6ELuT3oDwj Fixes: wrong channel mapping and rejected frames Wrong channel mapping and rejected frames Replicated through UnModified FFmpeg with plain output diff Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24677 Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24678 --- libavcodec/aac/aacdec_usac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index a11e4b5ffc..4d41a24f8d 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -623,6 +623,7 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx, m4ac->sampling_index = ff_aac_sample_rate_idx(m4ac->sample_rate); m4ac->sbr = sbr_ratio > 0; + m4ac->chan_config = 0; channel_config_idx = get_bits(gb, 5); /* channelConfigurationIndex */ if (!channel_config_idx) { @@ -1932,8 +1933,6 @@ static int parse_audio_preroll(AACDecContext *ac, GetBitContext *gb) if (ret < 0) { *m4ac = m4ac_bak; return ret; - } else { - ac->oc[1].m4ac.chan_config = 0; } /* 7.18.3.3 Bitrate adaption