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

Git pushed a commit to branch master
in repository ffmpeg.

commit cf725b93523fc3230e7fbf2f20e5c81a0aa9c929
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Oct 15 04:29:34 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sat Oct 24 20:19:14 2026 +0000

    avfilter/vf_fieldmatch: stop compare_fields() at the last complete field 
line
    
    Fixes: out of array read
    Fixes: 8Vo2w4S3WNCd
    
    Found during triage/review of the security report 0fHkOzVCAhre
    
    Out of array read Replicated through UnModified FFmpeg with ASAN
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_fieldmatch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index 7ce5d23fdb..384714f23d 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -496,7 +496,7 @@ static int compare_fields(FieldMatchContext *fm, int 
match1, int match2, int fie
     const AVFrame *src = fm->src;
 
     for (plane = 0; plane < (fm->mchroma ? 3 : 1); plane++) {
-        int x, y, temp1, temp2, fbase;
+        int x, y, temp1, temp2, fbase, stopy;
         const AVFrame *prev, *next;
         uint8_t *mapp    = fm->map_data[plane];
         int map_linesize = fm->map_linesize[plane];
@@ -519,6 +519,7 @@ static int compare_fields(FieldMatchContext *fm, int 
match1, int match2, int fie
         /* match1 */
         fbase = get_field_base(match1, field);
         srcf  = srcp + (fbase + 1) * src_linesize;
+        stopy = height - 1 - fbase;
         srcpf = srcf - srcf_linesize;
         srcnf = srcf + srcf_linesize;
         mapp  = mapp + fbase * map_linesize;
@@ -544,7 +545,7 @@ static int compare_fields(FieldMatchContext *fm, int 
match1, int match2, int fie
             build_diff_map(fm, prvnf, prvf_linesize, nxtnf, nxtf_linesize,
                            mapp + map_linesize, map_linesize, height, width, 
plane);
 
-        for (y = 2; y < height - 2; y += 2) {
+        for (y = 2; y < stopy; y += 2) {
             if (y0a == y1a || y < y0a || y > y1a) {
                 for (x = startx; x < stopx; x++) {
                     if (mapp[x] > 0 || mapp[x + map_linesize] > 0) {

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