The branch, master has been updated
       via  b2f5bc7fd33c5412d305b3327fbd40c527cb6e9e (commit)
      from  368b5e0ffc2dd5ec0c5b796be883a7802a74d848 (commit)


- Log -----------------------------------------------------------------
commit b2f5bc7fd33c5412d305b3327fbd40c527cb6e9e
Author:     Damiano Galassi <dam...@gmail.com>
AuthorDate: Fri Aug 22 17:01:26 2025 +0200
Commit:     James Almer <jamr...@gmail.com>
CommitDate: Sun Aug 24 13:31:53 2025 +0000

    movenc: ensure chapters track extradata is not null and populated
    
    fix a regression introduced in 4eca8df,
    writing chapters failed if chapters where
    not available before mov_write_header().

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 585a018e35..efd6329d70 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7463,6 +7463,14 @@ static int mov_create_chapter_track(AVFormatContext *s, 
int tracknum)
         return ret;
     memcpy(track->par->extradata, stub_header, sizeof(stub_header));
 
+    if (track->extradata == NULL) {
+        track->stsd_count     = 1;
+        track->extradata      = av_calloc(1, sizeof(*track->extradata));
+        track->extradata_size = av_calloc(1, sizeof(*track->extradata_size));
+        if (!track->extradata || !track->extradata_size)
+            return AVERROR(ENOMEM);
+    }
+
     track->extradata[0] = av_memdup(stub_header, sizeof(stub_header));
     if (!track->extradata[0])
         return AVERROR(ENOMEM);

-----------------------------------------------------------------------

Summary of changes:
 libavformat/movenc.c | 8 ++++++++
 1 file changed, 8 insertions(+)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- ffmpeg-cvslog@ffmpeg.org
To unsubscribe send an email to ffmpeg-cvslog-le...@ffmpeg.org

Reply via email to