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

Git pushed a commit to branch master
in repository ffmpeg.

commit 26f42482604cbcebd43c612d2f9011d70b51ee1b
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Nov 11 17:00:22 2026 +0100
Commit:     michaelni <[email protected]>
CommitDate: Sun Nov 15 20:24:34 2026 +0000

    avformat/imfdec: check the coherence of a seek target without overflow
    
    Fixes: signed integer overflow: 216000000000000 * 48000 cannot be 
represented in type 'int64_t' (aka 'long')
    Fixes: A5TJ4YnA1yYe
    
    Found during the triage of a finding from the review of 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25795
    
    Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
---
 libavformat/imfdec.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index e92c968865..46de8c9a9d 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -946,16 +946,8 @@ static int imf_probe(const AVProbeData *p)
 
 static int coherent_ts(int64_t ts, AVRational in_tb, AVRational out_tb)
 {
-    int dst_num;
-    int dst_den;
-    int ret;
-
-    ret = av_reduce(&dst_num, &dst_den, ts * in_tb.num * out_tb.den,
-                    in_tb.den * out_tb.num, INT64_MAX);
-    if (!ret || dst_den != 1)
-        return 0;
-
-    return 1;
+    return av_rescale_q_rnd(ts, in_tb, out_tb, AV_ROUND_DOWN) ==
+           av_rescale_q_rnd(ts, in_tb, out_tb, AV_ROUND_UP);
 }
 
 static int imf_seek(AVFormatContext *s, int stream_index, int64_t min_ts,

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