nutenc: don't av_malloc(0).
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 27 Apr 2011 15:29:02 +0000 (08:29 -0700)
committerRonald S. Bultje <rsbultje@gmail.com>
Wed, 4 May 2011 02:29:08 +0000 (22:29 -0400)
libavformat/nutenc.c

index df5dc6f..4ca761a 100644 (file)
@@ -584,7 +584,8 @@ static int write_header(AVFormatContext *s){
     nut->avf= s;
 
     nut->stream   = av_mallocz(sizeof(StreamContext)*s->nb_streams);
-    nut->chapter  = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
+    if (s->nb_chapters)
+        nut->chapter  = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
     nut->time_base= av_mallocz(sizeof(AVRational   )*(s->nb_streams +
                                                       s->nb_chapters));