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

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit 8961849e1a3b836a0578967033c5aace86cf96a6
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Nov 3 02:15:38 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sun Nov 15 02:43:47 2026 +0100

    avcodec/adxdec: validate the sample rate before changing the channel layout
    
    Null pointer dereference Replicated through UnModified FFmpeg with ASAN
    
    Fixes: null pointer dereference
    Fixes: kmrMEk1So1o7
    Fixes: AISLE-2026-0150-00566
    
    Found-by: Joshua Rogers (AISLE)
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit 515dcad73d77711507083cae3913c9327c0977c6)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/adxdec.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index a79ae430aa..3dfcf9be23 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -50,7 +50,7 @@
 static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
                              int bufsize, int *header_size, int *coeff)
 {
-    int offset, cutoff, channels;
+    int offset, cutoff, channels, sample_rate;
 
     if (bufsize < 24)
         return AVERROR_INVALIDDATA;
@@ -74,17 +74,17 @@ static int adx_decode_header(AVCodecContext *avctx, const 
uint8_t *buf,
     if (channels <= 0 || channels > MAX_CHANNELS)
         return AVERROR_INVALIDDATA;
 
+    /* sample rate */
+    sample_rate = AV_RB32(buf + 8);
+    if (sample_rate < 1 || sample_rate > INT_MAX / (channels * BLOCK_SIZE * 8))
+        return AVERROR_INVALIDDATA;
+
     if (avctx->ch_layout.nb_channels != channels) {
         av_channel_layout_uninit(&avctx->ch_layout);
         avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
         avctx->ch_layout.nb_channels = channels;
     }
-
-    /* sample rate */
-    avctx->sample_rate = AV_RB32(buf + 8);
-    if (avctx->sample_rate < 1 ||
-        avctx->sample_rate > INT_MAX / (channels * BLOCK_SIZE * 8))
-        return AVERROR_INVALIDDATA;
+    avctx->sample_rate = sample_rate;
 
     /* bit rate */
     avctx->bit_rate = avctx->sample_rate * channels * BLOCK_SIZE * 8 / 
BLOCK_SAMPLES;

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