Commit e1a4e4ed24 for ffmpeg
commit e1a4e4ed24c302df648a47106a93329cf2606780
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu Nov 12 22:59:16 2026 +0100
avfilter/scale_eval: restore the output width used for evaluating the height
Since 805931dfc8 the first evaluation of the width set ow to the
truncated expression result instead of the input width when it is
truncated to 0.
Found during triage of the security report nw59dSqw4SNa
diff --git a/libavfilter/scale_eval.c b/libavfilter/scale_eval.c
index 1778136bc2..ef07574820 100644
--- a/libavfilter/scale_eval.c
+++ b/libavfilter/scale_eval.c
@@ -99,7 +99,7 @@ int ff_scale_eval_dimensions(void *log_ctx,
av_expr_parse_and_eval(&res, (expr = w_expr),
var_names, var_values,
NULL, NULL, NULL, NULL, NULL, 0, log_ctx);
- var_values[VAR_OUT_W] = var_values[VAR_OW] = res == 0 ? inlink->w : trunc(res);
+ var_values[VAR_OUT_W] = var_values[VAR_OW] = trunc(res) == 0 ? inlink->w : trunc(res);
if ((ret = eval_dimension(log_ctx, (expr = h_expr), var_values, inlink->h, &eval_h)) < 0)
goto fail;