You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-10-06 05:47:18 +02:00
movenc: ensure chapters track extradata is not null and populated
fix a regression introduced in4eca8df
, writing chapters failed if chapters where not available before mov_write_header(). (cherry picked from commitb2f5bc7fd3
)
This commit is contained in:
committed by
James Almer
parent
140fd653ae
commit
e219c8f77b
@@ -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);
|
||||
|
Reference in New Issue
Block a user