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 65076f6d8ff9cc3c1d0b86bfd774de0d67cd568f
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Sep 9 04:10:43 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 04:36:59 2026 +0100

    swscale/utils: do not let a filter wider than the source read past the line
    
    Fixes: heap-buffer-overflow read in hScale8To15_c()
    Fixes: sws-filter-oob-handcrafted / gen3.py (fairy/pr21601-repro)
    Found-by: Forgejo Fairy while reviewing PR #21601
    (cherry picked from commit 53f88ba1cfde8d8357a9ce405e4be2709df0280c)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libswscale/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index e970b9f035..1b08b3cfca 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -511,7 +511,6 @@ static av_cold int initFilter(int16_t **outFilter, int32_t 
**filterPos,
         ret = RETCODE_USE_CASCADE;
         goto fail;
     }
-    *outFilterSize = filterSize;
 
     if (flags & SWS_PRINT_INFO)
         av_log(NULL, AV_LOG_VERBOSE,
@@ -576,6 +575,8 @@ static av_cold int initFilter(int16_t **outFilter, int32_t 
**filterPos,
         }
     }
 
+    *outFilterSize = FFMIN(filterSize, FFALIGN(srcW, filterAlign));
+
     // Note the +1 is for the MMX scaler which reads over the end
     /* align at 16 for AltiVec (needed by hScale_altivec_real) */
     *outFilter = av_calloc(dstW + 3, *outFilterSize * sizeof(**outFilter));

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