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

Git pushed a commit to branch master
in repository ffmpeg.

commit 356dfc3bd120cbd52b8a03389bcf85cd269217cf
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Sep 17 18:02:03 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sat Sep 19 18:47:12 2026 +0000

    avcodec/ituh263enc: compute the temporal reference with av_rescale_rnd()
    
    The hand written multiply and divide can overflow int64_t for a large
    time_base.num; av_rescale_rnd() computes the same truncating division
    exactly.
---
 libavcodec/ituh263enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index 56259783b0..e9c5d08a78 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -245,8 +245,8 @@ static int h263_encode_picture_header(MPVMainEncContext 
*const m)
     coded_frame_rate_base= (1000+best_clock_code)*best_divisor;
 
     put_bits(&s->pb, 22, 0x20); /* PSC */
-    temp_ref = s->picture_number * (int64_t)coded_frame_rate * 
s->c.avctx->time_base.num / //FIXME use timestamp
-                         (coded_frame_rate_base * 
(int64_t)s->c.avctx->time_base.den);
+    temp_ref = av_rescale_rnd(s->picture_number, coded_frame_rate * 
(int64_t)s->c.avctx->time_base.num, //FIXME use timestamp
+                              coded_frame_rate_base * 
(int64_t)s->c.avctx->time_base.den, AV_ROUND_ZERO);
     put_sbits(&s->pb, 8, temp_ref); /* TemporalReference */
 
     put_bits(&s->pb, 1, 1);     /* marker */

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