This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 3f18b1398a577b8d3367daf4695bdb64fcae208f
Author:     Trevor Hansen <[email protected]>
AuthorDate: Thu Nov 12 11:06:05 2026 +1100
Commit:     Lynne <[email protected]>
CommitDate: Thu Nov 12 01:13:33 2026 +0000

    avcodec/aac: take a missing sample rate from the configuration in the ER 
frame path
    
    The error-resilient output path never sets avctx->sample_rate from the
    stream configuration; it copies whatever the caller supplied into the
    output frame. The general-audio path and USAC both set it from the
    parsed configuration. AAC declares AV_CODEC_CAP_CHANNEL_CONF, so
    avcodec_open2() accepts a context with no sample rate, and a valid ER
    stream whose rate is only in its AudioSpecificConfig then outputs a
    frame with sample rate 0, which frame_validate() rejects with
    AVERROR_BUG (and which trips the av_assert0() in the decode fuzzer).
    
    When the caller supplied no sample rate, take it from the configuration
    before outputting the frame, so that such streams decode. A sample rate
    supplied by the caller is left alone, so nothing changes for streams
    that decode today.
    
    An ER object type can only be selected by a configuration with a valid
    sampling index, so the rate should always be positive after this;
    reject a non-positive one anyway, with the same message and error code
    as the general-audio path.
    
    Signed-off-by: Trevor Hansen <[email protected]>
---
 libavcodec/aac/aacdec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
index ba167eaab7..752b8ce521 100644
--- a/libavcodec/aac/aacdec.c
+++ b/libavcodec/aac/aacdec.c
@@ -2338,6 +2338,15 @@ static int aac_decode_er_frame(AVCodecContext *avctx, 
AVFrame *frame,
 
     spectral_to_sample(ac, samples);
 
+    if (avctx->sample_rate <= 0)
+        avctx->sample_rate = m4ac->sample_rate;
+
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Cannot output a frame without a valid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (!ac->frame->data[0] && samples) {
         av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
         return AVERROR_INVALIDDATA;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to