Merge commit '4d122b01e4ce539269ee2df193b061772c7374f6'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Aug 2013 10:26:19 +0000 (12:26 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Aug 2013 10:26:27 +0000 (12:26 +0200)
* commit '4d122b01e4ce539269ee2df193b061772c7374f6':
  movenc: Check for allocation failures in mov_create_chapter_track

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/movenc.c

@@@ -3393,10 -3018,9 +3393,12 @@@ static int mov_create_chapter_track(AVF
      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
 +    uint8_t chapter_properties[43] = { 0, 0, 0, 0, 0, 0, 0, 1, };
      track->enc->extradata = av_malloc(sizeof(chapter_properties));
      if (track->enc->extradata == NULL)
          return AVERROR(ENOMEM);