OSDN Git Service

movenc: use ff_alloc_extradata()
authorJames Almer <jamrial@gmail.com>
Sun, 13 Oct 2013 23:02:28 +0000 (20:02 -0300)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 14 Oct 2013 11:02:18 +0000 (13:02 +0200)
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/movenc.c

index 60c028e..3296762 100644 (file)
@@ -3507,10 +3507,8 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
 #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)
+    if (ff_alloc_extradata(track->enc, sizeof(chapter_properties)))
         return AVERROR(ENOMEM);
-    track->enc->extradata_size = sizeof(chapter_properties);
     memcpy(track->enc->extradata, chapter_properties, sizeof(chapter_properties));
 #else
     if (avio_open_dyn_buf(&pb) >= 0) {