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

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

commit 1623497c7a302d496eea98865de517cdfba2c0b0
Author:     Steven Liu <[email protected]>
AuthorDate: Tue Jun 16 21:40:37 2026 +0800
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sat Sep 19 14:27:03 2026 +0200

    avformat/dashdec: check NULL pointer of av_strtok value before use it
    
    fix issue: issues/23057 POC1
    release seg memory and return NULL if av_strtok return NULL.
    
    Signed-off-by: Steven Liu <[email protected]>
    (cherry picked from commit 813c28d1ce216502ee21d4912980689ad60333d3)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/dashdec.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 5372cacca8..84c9abe7ec 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -581,7 +581,7 @@ static enum AVMediaType get_content_type(xmlNodePtr node)
     return type;
 }
 
-static struct fragment *get_fragment(char *range)
+static struct fragment *get_fragment(AVFormatContext *s, char *range)
 {
     struct fragment *seg = av_mallocz(sizeof(struct fragment));
 
@@ -592,6 +592,11 @@ static struct fragment *get_fragment(char *range)
     if (range) {
         char *str_end_offset;
         char *str_offset = av_strtok(range, "-", &str_end_offset);
+        if (!str_offset) {
+            av_log(s, AV_LOG_WARNING, "%s will get invalid range\n", range);
+            av_freep(&seg);
+            return NULL;
+        }
         seg->url_offset = strtoll(str_offset, NULL, 10);
         seg->size = strtoll(str_end_offset, NULL, 10) - seg->url_offset + 1;
     }
@@ -617,7 +622,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext 
*s, struct representati
         range_val = xmlGetProp(fragmenturl_node, "range");
         if (initialization_val || range_val) {
             free_fragment(&rep->init_section);
-            rep->init_section = get_fragment(range_val);
+            rep->init_section = get_fragment(s, range_val);
             xmlFree(range_val);
             if (!rep->init_section) {
                 xmlFree(initialization_val);
@@ -638,7 +643,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext 
*s, struct representati
         media_val = xmlGetProp(fragmenturl_node, "media");
         range_val = xmlGetProp(fragmenturl_node, "mediaRange");
         if (media_val || range_val) {
-            struct fragment *seg = get_fragment(range_val);
+            struct fragment *seg = get_fragment(s, range_val);
             xmlFree(range_val);
             if (!seg) {
                 xmlFree(media_val);

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