ffmpeg/libavcodec/aac
Oliver Chang 715773df12
aacdec_usac: skip FD-specific decoding for LPD channels
`spectrum_decode` currently executes Frequency Domain (FD) decoding steps
for all channels, regardless of their `core_mode`. When a channel is in
Linear Prediction Domain (LPD) mode (`core_mode == 1`), FD-specific
parameters such as scalefactor offsets (`sfo`) and individual channel
stream (`ics`) information are not parsed.

This causes a global-buffer-overflow in `dequant_scalefactors`. Because
`spectrum_scale` is called on LPD channels, it uses stale or
uninitialized `sfo` values to index `ff_aac_pow2sf_tab`. In the reported
crash, a stale `sfo` value of 240 resulted in an index of 440
(240 + POW_SF2_ZERO), exceeding the table's size of 428.

Fix this by ensuring `spectrum_scale` and `imdct_and_windowing` are only
called for channels where `core_mode == 0` (FD).

Co-authored-by: CodeMender <codemender-patching@google.com>
Fixes: https://issues.oss-fuzz.com/486160985
(cherry picked from commit d519ab8993)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-04 15:57:20 +02:00
..
aacdec.c avcodec/aacdec: Fix heap-use-after-free in USAC decoding 2026-05-04 15:56:58 +02:00
aacdec.h aacdec_usac: use RefStruct to track unfinished extension buffers 2025-09-08 02:13:34 +02:00
aacdec_ac.c aacdec: add a decoder for AAC USAC (xHE-AAC) 2024-06-02 18:34:45 +02:00
aacdec_ac.h aacdec_ac: fix an overread 2024-06-21 10:50:21 +02:00
aacdec_dsp_template.c aacdec: add a decoder for AAC USAC (xHE-AAC) 2024-06-02 18:34:45 +02:00
aacdec_fixed.c aacdec_dsp: implement 768-point transform and windowing 2024-06-02 18:34:44 +02:00
aacdec_fixed_coupling.h aacdec: move aacdec.h into libavcodec/aac 2024-04-23 08:31:40 +02:00
aacdec_fixed_dequant.h aacdec: move spectrum decode and dequantization to a new file 2024-04-23 08:31:35 +02:00
aacdec_fixed_prediction.h aacdec: move prediction to separate files 2024-04-23 08:31:37 +02:00
aacdec_float.c aacdec_dsp: implement 768-point transform and windowing 2024-06-02 18:34:44 +02:00
aacdec_float_coupling.h aacdec: move aacdec.h into libavcodec/aac 2024-04-23 08:31:40 +02:00
aacdec_float_prediction.h aacdec: move prediction to separate files 2024-04-23 08:31:37 +02:00
aacdec_latm.h aacdec: add a decoder for AAC USAC (xHE-AAC) 2024-06-02 18:34:45 +02:00
aacdec_lpd.c avcodec/aac/aacdec_lpd: Limit get_unary() 2025-02-26 01:26:33 +01:00
aacdec_lpd.h aacdec: add a decoder for AAC USAC (xHE-AAC) 2024-06-02 18:34:45 +02:00
aacdec_proc_template.c avcodec/aac/aacdec: Fix linking errors with only one decoder enabled 2024-05-07 12:33:50 +02:00
aacdec_tab.c
aacdec_tab.h
aacdec_usac.c aacdec_usac: skip FD-specific decoding for LPD channels 2026-05-04 15:57:20 +02:00
aacdec_usac.h aacdec: add a decoder for AAC USAC (xHE-AAC) 2024-06-02 18:34:45 +02:00
Makefile aacdec: add a decoder for AAC USAC (xHE-AAC) 2024-06-02 18:34:45 +02:00