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

Git pushed a commit to branch master
in repository ffmpeg.

commit 5d85b7bfb2b024fd367ae3a938b4ac46a39e3a26
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sun Oct 25 05:48:24 2026 +0100
Commit:     michaelni <[email protected]>
CommitDate: Fri Nov 6 04:40:30 2026 +0000

    avcodec/dovi_rpuenc: compute the pixel rate without overflow
    
    Fixes: o7gcsAIJJTmP/testcase/dovi_pps_overflow.c
    Fixes: o7gcsAIJJTmP
    Fixes: signed integer overflow
    Signed integer overflow Replicated through API with UBSAN
    
    Found during the review of PR 25408.
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/dovi_rpuenc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c
index 2e567ad751..219283eca7 100644
--- a/libavcodec/dovi_rpuenc.c
+++ b/libavcodec/dovi_rpuenc.c
@@ -182,12 +182,9 @@ static av_cold int dovi_configure_ext(DOVIContext *s, enum 
AVCodecID codec_id,
         }
     }
 
-    pps = width * height;
-    if (framerate.num > 0 && framerate.den > 0) {
-        pps = pps * framerate.num / framerate.den;
-    } else {
-        pps *= 25; /* sanity fallback */
-    }
+    if (framerate.num <= 0 || framerate.den <= 0)
+        framerate = (AVRational){ 25, 1 }; /* sanity fallback */
+    pps = av_rescale_rnd((int64_t)width * height, framerate.num, 
framerate.den, AV_ROUND_DOWN);
 
     dv_level = 0;
     for (int i = 1; i < FF_ARRAY_ELEMS(dv_levels); i++) {

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