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 2f6fd79aafe0e17da6e6fab1084490c7beb8e796
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Nov 13 01:28:06 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 14:55:43 2026 +0100

    avfilter/af_adelay: do not reallocate the delay line when it shrinks
    
    After a failed increase av_fast_realloc() has the size 0 recorded, the
    next decrease then reallocated the delay line to the smaller size
    before its samples were moved.
    
    Fixes: out of array read
    Fixes: SshCIGTXgBSi
    
    Found during the triage of a finding from the review of 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25800
    
    Out of array read Replicated through UnModified FFmpeg with ASAN
    
    (cherry picked from commit e557c9cc68b272fbfd57eadf86cb4d42ac674659)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/af_adelay.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index 24e390e0bc..ebca63f67d 100644
--- a/libavfilter/af_adelay.c
+++ b/libavfilter/af_adelay.c
@@ -122,9 +122,12 @@ static int resize_samples_## name ##p(ChanDelay *d, 
int64_t new_delay)
         return AVERROR(ENOMEM);                                                
                         \
     }                                                                          
                         \
                                                                                
                         \
-    samples = (type *) av_fast_realloc(d->samples, &d->samples_size, new_delay 
* sizeof(type));         \
-    if (!samples) {                                                            
                         \
-        return AVERROR(ENOMEM);                                                
                         \
+    samples = (type *) d->samples;                                             
                         \
+    if (new_delay > d->delay) {                                                
                         \
+        samples = (type *) av_fast_realloc(d->samples, &d->samples_size, 
new_delay * sizeof(type));     \
+        if (!samples) {                                                        
                         \
+            return AVERROR(ENOMEM);                                            
                         \
+        }                                                                      
                         \
     }                                                                          
                         \
                                                                                
                         \
     if (new_delay < d->delay) {                                                
                         \

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