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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 338889c0d9 avfilter/vf_scale_d3d12: fix integer overflow in input 
framerate calculation
338889c0d9 is described below

commit 338889c0d9794782ea1b247bce934df50e5ade8c
Author:     Timo Rothenpieler <[email protected]>
AuthorDate: Mon Dec 8 14:18:36 2025 +0100
Commit:     Timo Rothenpieler <[email protected]>
CommitDate: Mon Dec 8 14:22:16 2025 +0100

    avfilter/vf_scale_d3d12: fix integer overflow in input framerate calculation
    
    Also removes pointless intermediate variables that caused
    the overflow and truncation to happen in the first place.
    
    Fixes #YWH-PGM40646-1
---
 libavfilter/vf_scale_d3d12.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_scale_d3d12.c b/libavfilter/vf_scale_d3d12.c
index 6950feb32b..8066bd0725 100644
--- a/libavfilter/vf_scale_d3d12.c
+++ b/libavfilter/vf_scale_d3d12.c
@@ -155,8 +155,6 @@ static DXGI_COLOR_SPACE_TYPE get_dxgi_colorspace(enum 
AVColorSpace colorspace, e
 
 static AVRational get_input_framerate(AVFilterContext *ctx, AVFilterLink 
*inlink, AVFrame *in)
 {
-    int64_t duration_scaled;
-    int64_t time_base_den;
     AVRational framerate = {0, 0};
 
     if (in->duration > 0 && inlink->time_base.num > 0 && inlink->time_base.den 
> 0) {
@@ -164,13 +162,9 @@ static AVRational get_input_framerate(AVFilterContext 
*ctx, AVFilterLink *inlink
         * Calculate framerate from frame duration and timebase
         * framerate = 1 / (duration * timebase)
         */
-        duration_scaled = in->duration * inlink->time_base.num;
-        time_base_den = inlink->time_base.den;
-        framerate.num = time_base_den;
-        framerate.den = duration_scaled;
-        /* Reduce the fraction */
         av_reduce(&framerate.num, &framerate.den,
-                 framerate.num, framerate.den, INT_MAX);
+                  inlink->time_base.den, in->duration * inlink->time_base.num,
+                  INT_MAX);
     } else if (inlink->time_base.num > 0 && inlink->time_base.den > 0) {
         /* Estimate from timebase (inverse of timebase is often the framerate) 
*/
         framerate.num = inlink->time_base.den;

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to