Commit 3b1cbb5e0f for ffmpeg
commit 3b1cbb5e0f66b85d15f1d3527436520b3f4711ec
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu Oct 29 00:00:03 2026 +0100
avcodec/bsf/aac_adtstoasc: check the bit reader initialization before the PCE
Fixes: RG0je5bJzuAD
Fixes: AISLE-2026-0150-00525
Fixes: NULL pointer dereference
NULL pointer dereference Replicated through UnModified FFmpeg with ASAN and UBSAN
Found-by: Joshua Rogers <joshua.rogers@aisle.com>
diff --git a/libavcodec/bsf/aac_adtstoasc.c b/libavcodec/bsf/aac_adtstoasc.c
index dd6e8e8a38..9f8e61e422 100644
--- a/libavcodec/bsf/aac_adtstoasc.c
+++ b/libavcodec/bsf/aac_adtstoasc.c
@@ -79,7 +79,9 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *pkt)
if (!hdr.chan_config) {
GetBitContext gb;
- init_get_bits(&gb, pkt->data, pkt->size * 8);
+ ret = init_get_bits8(&gb, pkt->data, pkt->size);
+ if (ret < 0)
+ goto fail;
if (get_bits(&gb, 3) != 5) {
avpriv_report_missing_feature(bsfc,
"PCE-based channel configuration "