Commit 68ca3ab63b for ffmpeg
commit 68ca3ab63b506a724e1729e62ed74940f43a9d93
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Fri Nov 13 01:58:08 2026 +0100
avfilter/vf_fftfilt: mask the coordinates of weight_Y/U/V()
Fixes: heap-buffer-overflow (read)
Found during triage of the security report nw59dSqw4SNa
Out of array read Replicated through UnModified FFmpeg with ASAN
diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
index 043479b0c3..4b0851dad6 100644
--- a/libavfilter/vf_fftfilt.c
+++ b/libavfilter/vf_fftfilt.c
@@ -107,7 +107,8 @@ AVFILTER_DEFINE_CLASS(fftfilt);
static inline double lum(void *priv, double x, double y, int plane)
{
FFTFILTContext *s = priv;
- return s->rdft_vdata_out[plane][(int)x * s->rdft_vstride[plane] + (int)y];
+ return s->rdft_vdata_out[plane][((int)x & (s->rdft_hlen[plane] - 1)) * s->rdft_vstride[plane] +
+ ((int)y & (s->rdft_vlen[plane] - 1))];
}
static double weight_Y(void *priv, double x, double y) { return lum(priv, x, y, Y); }