Commit 0bd15938 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '4d122b01'

* commit '4d122b01':
  movenc: Check for allocation failures in mov_create_chapter_track
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 535d9a93 4d122b01
......@@ -3393,6 +3393,8 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
track->tag = MKTAG('t','e','x','t');
track->timescale = MOV_TIMESCALE;
track->enc = avcodec_alloc_context3(NULL);
if (!track->enc)
return AVERROR(ENOMEM);
track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
#if 0
// These properties are required to make QT recognize the chapter track
......@@ -3460,6 +3462,8 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
len = strlen(t->value);
pkt.size = len + 2;
pkt.data = av_malloc(pkt.size);
if (!pkt.data)
return AVERROR(ENOMEM);
AV_WB16(pkt.data, len);
memcpy(pkt.data + 2, t->value, len);
ff_mov_write_packet(s, &pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment