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

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

commit e706a35a4ec67f045bcb439db956035af4b935f1
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed May 20 01:24:54 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Jun 18 20:30:53 2026 +0200

    avformat/hls: Check TIME-OFFSET value
    
    Fixes: UB with out of range values
    Fixes: poc_overflow.m3u8
    
    Found-by: jiale yao
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit 59094859a8affb9f8715a003d9fa3d0c13041d56)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/hls.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 50dab67d0f..900e96c4b0 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -959,9 +959,14 @@ static int parse_playlist(HLSContext *c, const char *url,
                 goto fail;
             }
             if (av_strstart(ptr, "TIME-OFFSET=", &time_offset_value)) {
-                float offset = strtof(time_offset_value, NULL);
-                pls->start_time_offset = offset * AV_TIME_BASE;
-                pls->time_offset_flag = 1;
+                double offset = strtod(time_offset_value, NULL) * AV_TIME_BASE;
+                if (offset >= -0x1p63 && offset < 0x1p63) {
+                    pls->start_time_offset = offset;
+                    pls->time_offset_flag = 1;
+                } else {
+                    av_log(c->ctx, AV_LOG_WARNING, "TIME-OFFSET value is"
+                                                    "invalid, it will be 
ignored");
+                }
             } else {
                 av_log(c->ctx, AV_LOG_WARNING, "#EXT-X-START value is"
                                                 "invalid, it will be ignored");

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

Reply via email to