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

Git pushed a commit to branch master
in repository ffmpeg.

commit 2bcaf650e988014809a8025c53f85986988db73f
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Nov 6 01:58:10 2026 +0100
Commit:     michaelni <[email protected]>
CommitDate: Sun Nov 8 15:37:01 2026 +0000

    avformat/dashdec: limit the number of segments of a SegmentTimeline
    
    Fixes: Timeout
    Fixes: JyLanfEvTbhF
    Fixes: swarm-Unbounded-timeline-repeat-causes-CPU-DoS-699421
    
    Found-by: zhang xingxing <[email protected]>
    
    Timeout Replicated through UnModified FFmpeg (ffprobe) with a timeout
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/dashdec.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 00f91fc205..43cbfa18ab 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -34,6 +34,7 @@
 #include "url.h"
 
 #define INITIAL_BUFFER_SIZE 32768
+#define MAX_TIMELINE_SEGMENTS (1 << 24)
 
 struct fragment {
     int64_t url_offset;
@@ -1125,6 +1126,16 @@ static int parse_manifest_representation(AVFormatContext 
*s, const char *url,
         goto free;
     }
 
+    int64_t nb_timeline_segments = 0;
+    for (int i = 0; i < rep->n_timelines; i++) {
+        nb_timeline_segments += av_clip64(rep->timelines[i]->repeat, 0, 
INT_MAX) + 1;
+        if (nb_timeline_segments > MAX_TIMELINE_SEGMENTS) {
+            av_log(s, AV_LOG_ERROR, "Too many segments in SegmentTimeline\n");
+            ret = AVERROR_INVALIDDATA;
+            goto free;
+        }
+    }
+
     if (rep->fragment_duration > 0 && !rep->fragment_timescale)
         rep->fragment_timescale = 1;
     rep->bandwidth = rep_bandwidth_val ? atoi(rep_bandwidth_val) : 0;

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