Commit 0619463169 for ffmpeg

commit 06194631698303b77c84d7c5729f45bc5b8ffc64
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Wed Nov 11 17:00:22 2026 +0100

    avformat/imfdec: rescale the seek target without multiplying ints

    Fixes: signed integer overflow: 48000 * 1048576 cannot be represented in type 'int'
    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

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index 6b4bb2ac94..e92c968865 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -996,9 +996,7 @@ static int imf_seek(AVFormatContext *s, int stream_index, int64_t min_ts,
                          st->time_base))
             av_log(s, AV_LOG_WARNING, "Seek position is not coherent across tracks\n");

-        dts = av_rescale(ts,
-                         st->time_base.den * c->cpl->edit_rate.den,
-                         st->time_base.num * c->cpl->edit_rate.num);
+        dts = av_rescale_q(ts, av_inv_q(c->cpl->edit_rate), st->time_base);

         av_log(s, AV_LOG_DEBUG, "Seeking to dts=%" PRId64 " on stream_index=%d\n",
                dts, i);