From 05a2f2029df05b0de0d2de435ed659c2b4a22eef Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 6 Oct 2026 00:14:12 +0200 Subject: [PATCH] avfilter/f_select: declare non-scene expressions as handling changed frame parameters Found during review of the fix for the security report RqgTntCAW2qN. --- libavfilter/f_select.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index 3f0c908d16..c1c93fd973 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -444,6 +444,11 @@ static int activate(AVFilterContext *ctx) while ((ret = ff_inlink_consume_frame(inlink, &in))) { if (ret < 0) return ret; + if (select->do_scene_detect && + (ret = ff_inlink_check_frame_params(inlink, in, 0)) < 0) { + av_frame_free(&in); + return ret; + } select_frame(ctx, in); if (select->select && !ff_outlink_get_status(ctx->outputs[select->select_out])) return ff_filter_frame(ctx->outputs[select->select_out], in); @@ -564,5 +569,6 @@ const FFFilter ff_vf_select = { .priv_size = sizeof(SelectContext), FILTER_INPUTS(avfilter_vf_select_inputs), FILTER_QUERY_FUNC2(query_formats), + .flags_internal = FF_FILTER_FLAG_DYNAMIC_FRAME_PARAMS, }; #endif /* CONFIG_SELECT_FILTER */