mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
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().
This commit is contained in:
committed by
James Almer
parent
368b5e0ffc
commit
b2f5bc7fd3
@@ -7463,6 +7463,14 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
|
|||||||
return ret;
|
return ret;
|
||||||
memcpy(track->par->extradata, stub_header, sizeof(stub_header));
|
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));
|
track->extradata[0] = av_memdup(stub_header, sizeof(stub_header));
|
||||||
if (!track->extradata[0])
|
if (!track->extradata[0])
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|||||||
Reference in New Issue
Block a user