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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 23918b3200 avcodec: nellymoser: reject invalid sample rate
23918b3200 is described below

commit 23918b32004a517278ba441b9d0cb5307ced0cdb
Author:     Marvin Scholz <[email protected]>
AuthorDate: Tue Oct 13 21:25:13 2026 +0000
Commit:     Marvin Scholz <[email protected]>
CommitDate: Thu Oct 22 03:14:59 2026 +0000

    avcodec: nellymoser: reject invalid sample rate
    
    Nellymoser expects the caller to set the samplerate, as it
    doesn't read it from the bitstream. However the generic check
    for this is bypassed as it has the AV_CODEC_CAP_CHANNEL_CONF
    capability because it does set the channel configuration,
    however that cap also bypasses the generic samplerate check.
    
    This is mostly harmless as nellymoser doesn't care about the
    samplerate, but since f566032bfda2 it would cause an AVERROR_BUG
    to be returned to the caller, so better reject it outright in
    the decoder.
    
    Signed-off-by: Marvin Scholz <[email protected]>
---
 libavcodec/nellymoserdec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index 7037d6b0ba..04b0c01afe 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -121,6 +121,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
     float scale = 1.0f;
     NellyMoserDecodeContext *s = avctx->priv_data;
 
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR, "Sample rate %d is invalid\n", 
avctx->sample_rate);
+        return AVERROR(EINVAL);
+    }
+
     s->avctx = avctx;
     s->imdct_out = s->imdct_buf[0];
     s->imdct_prev = s->imdct_buf[1];

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