This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit 42bcce8106b2e404ed433b0121949715c499f9ab
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sat Nov 14 05:22:02 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 14:55:44 2026 +0100

    avfilter/vf_scale: reject commands using ref variables without a ref input
    
    Fixes: out of array read
    Fixes: qNXODI0YyLo1
    Fixes: AISLE-2026-0166-00236
    
    Found-by: Joshua Rogers (AISLE)
    The rejected expression case was found during triage of the security report
    
    Out of array read Replicated through UnModified FFmpeg with ASAN
    
    (cherry picked from commit dd1b4e4ba5c3280638fed06a88bf25690564170b)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_scale.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 69e69bb8ea..2393661ba5 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -257,7 +257,7 @@ static int check_exprs(AVFilterContext *ctx)
 static int scale_parse_expr(AVFilterContext *ctx, char *str_expr, AVExpr 
**pexpr_ptr, const char *var, const char *args)
 {
     ScaleContext *scale = ctx->priv;
-    int ret, is_inited = 0;
+    int ret, is_inited = 0, old_uses_ref = scale->uses_ref;
     char *old_str_expr = NULL;
     AVExpr *old_pexpr = NULL;
 
@@ -285,6 +285,12 @@ static int scale_parse_expr(AVFilterContext *ctx, char 
*str_expr, AVExpr **pexpr
     if (ret < 0)
         goto revert;
 
+    if (is_inited && scale->uses_ref && ctx->nb_inputs == 1) {
+        av_log(ctx, AV_LOG_ERROR, "Expressions with ref variables need the ref 
input, a command cannot add it.\n");
+        ret = AVERROR(EINVAL);
+        goto revert;
+    }
+
     if (is_inited && (ret = config_props(ctx->outputs[0])) < 0)
         goto revert;
 
@@ -295,6 +301,7 @@ static int scale_parse_expr(AVFilterContext *ctx, char 
*str_expr, AVExpr **pexpr
     return 0;
 
 revert:
+    scale->uses_ref = old_uses_ref;
     av_expr_free(*pexpr_ptr);
     *pexpr_ptr = NULL;
     if (old_str_expr) {

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to