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 256d93413f avformat/mov: Fix negative index given to 
can_seek_to_key_sample()
256d93413f is described below

commit 256d93413f260e1524c2ab994dc72c4edaa0d04c
Author:     Dale Curtis <[email protected]>
AuthorDate: Thu Apr 30 21:01:33 2026 +0000
Commit:     James Almer <[email protected]>
CommitDate: Tue May 5 21:26:38 2026 +0000

    avformat/mov: Fix negative index given to can_seek_to_key_sample()
    
    The potentially negative return value of av_index_search_timestamp()
    wasn't being handled before passing it to can_seek_to_key_sample().
    
    Found by Wongi Lee (@_qwerty_po) of Theori with Xint Code,
    Jungwoo Lee (@physicube).
    
    Signed-off-by: Dale Curtis <[email protected]>
---
 libavformat/mov.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index f01ec86236..0d982e5a79 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -11599,6 +11599,7 @@ static int can_seek_to_key_sample(AVStream *st, int 
sample, int64_t requested_pt
     if (sample >= sc->sample_offsets_count)
         return 1;
 
+    av_assert0(sample >= 0);
     key_sample_dts = sti->index_entries[sample].timestamp;
     key_sample_pts = key_sample_dts + sc->sample_offsets[sample] + 
sc->dts_shift;
 
@@ -11642,6 +11643,8 @@ static int mov_seek_stream(AVFormatContext *s, AVStream 
*st, int64_t timestamp,
 
         next_ts = timestamp - FFMAX(sc->min_sample_duration, 1);
         requested_sample = av_index_search_timestamp(st, next_ts, flags);
+        if (requested_sample < 0)
+            return AVERROR_INVALIDDATA;
 
         // If we've reached a different sample trying to find a good pts to
         // seek to, give up searching because we'll end up seeking back to

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

Reply via email to