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

Git pushed a commit to branch master
in repository ffmpeg.

commit 50ee1153fa06199334fd004e986f1dd57f5e8037
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sun Sep 13 21:22:03 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sat Sep 19 01:16:28 2026 +0000

    avcodec/nellymoserenc: handle trellis implementation failure
    
    Found during triage/review of the security report.
    
    Fixes: index -2147483648 out of bounds for type 'float[35768]'
    Fixes: out of array read
    Fixes: 9UQo8TUCJdYw
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/nellymoserenc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c
index 5de624b7dc..197bb1c1a2 100644
--- a/libavcodec/nellymoserenc.c
+++ b/libavcodec/nellymoserenc.c
@@ -235,7 +235,7 @@ static inline float distance(float x, float y, int band)
     return tmp * tmp;
 }
 
-static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int 
*idx_table)
+static int get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int 
*idx_table)
 {
     int i, j, band, best_idx;
     float power_candidate, best_val;
@@ -278,7 +278,6 @@ static void get_exponent_dynamic(NellyMoserEncodeContext 
*s, float *cand, int *i
                 }
             }
         }
-        av_assert1(c);
     }
 
     best_val = INFINITY;
@@ -290,12 +289,15 @@ static void get_exponent_dynamic(NellyMoserEncodeContext 
*s, float *cand, int *i
             best_idx = i;
         }
     }
+    if (best_idx < 0)
+        return AVERROR(EINVAL);
     for (band = NELLY_BANDS - 1; band >= 0; band--) {
         idx_table[band] = path[band][best_idx];
         if (band) {
             best_idx -= ff_nelly_delta_table[path[band][best_idx]];
         }
     }
+    return 0;
 }
 
 /**
@@ -333,7 +335,9 @@ static int encode_block(NellyMoserEncodeContext *s, 
unsigned char *output, int o
     }
 
     if (s->avctx->trellis) {
-        get_exponent_dynamic(s, cand, idx_table);
+        int ret = get_exponent_dynamic(s, cand, idx_table);
+        if (ret < 0)
+            return ret;
     } else {
         get_exponent_greedy(s, cand, idx_table);
     }

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