aboutsummaryrefslogtreecommitdiffstats
path: root/compat/atomics/pthread/stdatomic.h
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2025-08-11 22:26:35 +0900
committermichaelni <michael@niedermayer.cc>2025-08-19 14:32:21 +0000
commitc05fc27dd33b361eb0105157ab7d3a01c2ffa782 (patch)
tree06b7045fa6cd514a921db2da2ec0c0e0ed1a2d88 /compat/atomics/pthread/stdatomic.h
parentcdee519d40e61bd65ba5b3fbec00acd50a08d0d9 (diff)
downloadffmpeg-c05fc27dd33b361eb0105157ab7d3a01c2ffa782.tar.gz
aacdec_usac: use RefStruct to track unfinished extension buffers
Extensions in AAC USAC can be stored across multiple frames (mainly to keep CBR compliance). This means that we need to reallocate a buffer when new data is received, accumulate the bitstream data, and so on until the end of extension flag is signalled and the extension can be decoded. This is made more complicated by the way in which the AAC channel layout switching is performed. After decades of evolution, our AAC decoder evolved to double-buffer its entire configuration. All changes are buffered, verified, and applied, on a per-frame basis if required, in often random order. Since we allocate the extension data on heap, this means that if configuration is applied, in order to avoid double-freeing, we have to keep track of what we've allocated. It should be noted that extensions which are spread in multiple frames are generally rare, so an optimization to introduce av_refstruct_realloc() wouldn't generally be useful across the codebase. Therefore, a copy is good enough for now. Thanks to Michael Niedermayer for additional fixing. Fixes: double free Fixes: 393523547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6740617236905984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Diffstat (limited to 'compat/atomics/pthread/stdatomic.h')
0 files changed, 0 insertions, 0 deletions