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

Git pushed a commit to branch release/8.0
in repository ffmpeg.

commit bad4558dd0ebb1594484553602802be9cb564b8e
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Sep 15 06:02:19 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Wed Oct 14 23:49:49 2026 +0200

    avformat/asfdec_f: index the seek position table by ASF stream number
    
    Fixes: stack buffer overflow
    Fixes: M3Ib1Zm6OX8V/testcase/crafted.asf / gen.py
    Fixes: M3Ib1Zm6OX8V
    Found-by: Zheng Yu @ Depthfirst
    (cherry picked from commit 1088e8b43e7f367a7311b7a51410fcf149d6cda8)
---
 libavformat/asfdec_f.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index c9010179b8..c765f948c1 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -1449,9 +1449,9 @@ static int64_t asf_read_pts(AVFormatContext *s, int 
stream_index,
     int64_t pts;
     int64_t pos = *ppos;
     int i;
-    int64_t start_pos[ASF_MAX_STREAMS];
+    int64_t start_pos[FF_ARRAY_ELEMS(asf->streams)];
 
-    for (i = 0; i < s->nb_streams; i++)
+    for (i = 0; i < FF_ARRAY_ELEMS(start_pos); i++)
         start_pos[i] = pos;
 
     if (s->packet_size > 0)
@@ -1473,17 +1473,17 @@ static int64_t asf_read_pts(AVFormatContext *s, int 
stream_index,
         pts = pkt->dts;
 
         if (pkt->flags & AV_PKT_FLAG_KEY) {
-            i = pkt->stream_index;
+            AVStream *st = s->streams[pkt->stream_index];
 
-            asf_st = &asf->streams[s->streams[i]->id];
+            asf_st = &asf->streams[st->id];
 
 //            assert((asf_st->packet_pos - s->data_offset) % s->packet_size == 
0);
             pos = asf_st->packet_pos;
             av_assert1(pkt->pos == asf_st->packet_pos);
 
-            av_add_index_entry(s->streams[i], pos, pts, pkt->size,
-                               pos - start_pos[i] + 1, AVINDEX_KEYFRAME);
-            start_pos[i] = asf_st->packet_pos + 1;
+            av_add_index_entry(st, pos, pts, pkt->size,
+                               pos - start_pos[st->id] + 1, AVINDEX_KEYFRAME);
+            start_pos[st->id] = asf_st->packet_pos + 1;
 
             if (pkt->stream_index == stream_index) {
                 av_packet_unref(pkt);

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