Commit 78d1c84ab8 for ffmpeg

commit 78d1c84ab89b397af58f6575e6a0c25a587da89f
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Fri Nov 13 03:34:32 2026 +0100

    avfilter/vf_fftfilt: return 0 from weight_Y/U/V() for planes that do not exist

    Gray input has no chroma planes, weight_U() and weight_V() read through
    a NULL pointer for it.

    Fixes: null pointer dereference
    Fixes: YFf7RMV2B1hG

    Found during review of the fixes for the security report nw59dSqw4SNa

    Null pointer dereference Replicated through UnModified FFmpeg with UBSAN

diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
index 4b0851dad6..610e644b84 100644
--- a/libavfilter/vf_fftfilt.c
+++ b/libavfilter/vf_fftfilt.c
@@ -107,6 +107,8 @@ AVFILTER_DEFINE_CLASS(fftfilt);
 static inline double lum(void *priv, double x, double y, int plane)
 {
     FFTFILTContext *s = priv;
+    if (!s->rdft_vdata_out[plane])
+        return 0;
     return s->rdft_vdata_out[plane][((int)x & (s->rdft_hlen[plane] - 1)) * s->rdft_vstride[plane] +
                                     ((int)y & (s->rdft_vlen[plane] - 1))];
 }