PR #23770 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23770
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23770.patch

Fixes: out of array access
Fixes: ffv1_poc/test_ffv1_8bit_v4.avi
Fixes: 6p0ahHBxreqG
Found-by: SecBuddyF - Tencent KeenLab



>From 3ebc7b1e2dd4ff105a3d1c8de819885de40f160c Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Fri, 10 Jul 2026 04:07:27 +0200
Subject: [PATCH] avcodec/ffv1dec: mask the fltmap index on the 8bit remap path

Fixes: out of array access
Fixes: ffv1_poc/test_ffv1_8bit_v4.avi
Fixes: 6p0ahHBxreqG
Found-by: SecBuddyF - Tencent KeenLab
---
 libavcodec/ffv1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 0c0689c81f..ba973ab76f 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -138,7 +138,7 @@ static int decode_plane(FFV1Context *f, FFV1SliceContext 
*sc,
                 return ret;
             if (sc->remap)
                 for (x = 0; x < w; x++)
-                    sample[1][x] = sc->fltmap[remap_index][sample[1][x]];
+                    sample[1][x] = sc->fltmap[remap_index][sample[1][x] & 
mask];
             for (x = 0; x < w; x++)
                 src[x*pixel_stride + stride * y] = sample[1][x];
         } else {
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to