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

Git pushed a commit to branch master
in repository ffmpeg.

commit 46dd03dabacea4b35ef1b3853c80920ec67efb43
Author:     lusoris <[email protected]>
AuthorDate: Sat Oct 31 03:54:19 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Thu Nov 12 00:49:31 2026 +0000

    avcodec/aacenc: make psychoacoustic window-count bound explicit
    
    GCC 16.2.1 reports -Wstringop-overflow in frame encoding because the
    psychoacoustic window count, which comes from an indirect model
    callback, is not visibly bounded before it indexes the per-window
    arrays. The installed window callbacks and the LFE path already return
    one or eight windows. Check that explicitly so the bound is visible to
    the compiler, returning AVERROR_BUG if it is ever not met. Input
    acceptance and encoding with either window count are unchanged.
    
    Signed-off-by: lusoris <[email protected]>
---
 libavcodec/aacenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index aadb9e6e17..96612625b2 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -1358,6 +1358,12 @@ static int aac_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
                 wi[ch] = s->psy.model->window(&s->psy, samples2, la, 
s->cur_channel,
                                               ics->window_sequence[0]);
             }
+            if (wi[ch].num_windows != 1 && wi[ch].num_windows != 8) {
+                av_log(avctx, AV_LOG_ERROR,
+                       "Psychoacoustic model returned invalid window count 
%d\n",
+                       wi[ch].num_windows);
+                return AVERROR_BUG;
+            }
             ics->window_sequence[1] = ics->window_sequence[0];
             ics->window_sequence[0] = wi[ch].window_type[0];
             ics->use_kb_window[1]   = ics->use_kb_window[0];

-- 
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