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

Git pushed a commit to branch master
in repository ffmpeg.

commit 63a9ce3921dc4e4cfbe0a5f729825fcaddc2a64e
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Oct 15 04:06:26 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 19 23:51:00 2026 +0000

    avfilter/vf_pad_vaapi: do the x/y range check and centering in 64bit
    
    Fixes: Ilayk1MzOixN
    Fixes: swarm-Signed-integer-overflow-in-pad-x-y-bounds-check-499261
    Regression since: 42eb10ecc6
    
    Found-by: zhang xingxing <[email protected]>
    The report suggested, among other options, widening the comparison.
    The overflow in the centering was found during review of the fixes for the 
report.
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_pad_vaapi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_pad_vaapi.c b/libavfilter/vf_pad_vaapi.c
index 5e9dad3065..a6ceae5b75 100644
--- a/libavfilter/vf_pad_vaapi.c
+++ b/libavfilter/vf_pad_vaapi.c
@@ -133,10 +133,10 @@ static int pad_vaapi_config_output(AVFilterLink *outlink)
         return ret;
     ctx->x = var_values[VAR_X] = res;
 
-    if (ctx->x < 0 || ctx->x + inlink->w > ctx->w)
-        ctx->x = var_values[VAR_X] = (ctx->w - inlink->w) / 2;
-    if (ctx->y < 0 || ctx->y + inlink->h > ctx->h)
-        ctx->y = var_values[VAR_Y] = (ctx->h - inlink->h) / 2;
+    if (ctx->x < 0 || (int64_t)ctx->x + inlink->w > ctx->w)
+        ctx->x = var_values[VAR_X] = ((int64_t)ctx->w - inlink->w) / 2;
+    if (ctx->y < 0 || (int64_t)ctx->y + inlink->h > ctx->h)
+        ctx->y = var_values[VAR_Y] = ((int64_t)ctx->h - inlink->h) / 2;
 
     /* sanity check params */
     if (ctx->w < inlink->w || ctx->h < inlink->h) {

-- 
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