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 53f88ba1cf swscale/utils: do not let a filter wider than the source 
read past the line
53f88ba1cf is described below

commit 53f88ba1cfde8d8357a9ce405e4be2709df0280c
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Sep 9 04:10:43 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Nov 16 13:38:21 2026 +0000

    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
---
 libswscale/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 678e53f405..0cd80ede65 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -512,7 +512,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,
@@ -577,6 +576,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