Commit c1d0b9344c for ffmpeg

commit c1d0b9344cd5a41070c12c86d02120efb37e9fd5
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Thu Nov 12 01:31:17 2026 +0100

    avfilter/vf_yaepblur: clamp the radius of each frame

    Fixes: out of array read
    Fixes: signed integer overflow
    Fixes: tdbi5LrAh1Pq

    Found during the triage of a finding from the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25800

    Out of array read Replicated through UnModified FFmpeg with ASAN
    Signed integer overflow Replicated through UnModified FFmpeg with UBSAN

diff --git a/libavfilter/vf_yaepblur.c b/libavfilter/vf_yaepblur.c
index 59f3501f35..748a2f7a58 100644
--- a/libavfilter/vf_yaepblur.c
+++ b/libavfilter/vf_yaepblur.c
@@ -224,6 +224,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     const int nb_threads = ff_filter_get_nb_threads(ctx);
     ThreadData td;

+    s->radius = FFMIN(s->radius, AV_CEIL_RSHIFT(FFMIN(inlink->w, inlink->h), 1));
+
     if (av_frame_is_writable(in)) {
         out = in;
     } else {
@@ -279,8 +281,6 @@ static int config_input(AVFilterLink *inlink)
     s->planeheight[0] = s->planeheight[3] = inlink->h;
     s->nb_planes = av_pix_fmt_count_planes(inlink->format);

-    s->radius = FFMIN(s->radius, AV_CEIL_RSHIFT(FFMIN(inlink->w, inlink->h), 1));
-
     if (s->depth <= 8) {
         s->pre_calculate_row = pre_calculate_row_byte;
         s->filter_slice      = filter_slice_byte;