[FFmpeg-cvslog] nutenc: don't av_malloc(0).

Ronald S. Bultje git at videolan.org
Thu May 5 03:30:44 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Wed Apr 27 08:29:02 2011 -0700| [25588d3b8a556eb5d0d3239d8c6aee968ea18896] | committer: Ronald S. Bultje

nutenc: don't av_malloc(0).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25588d3b8a556eb5d0d3239d8c6aee968ea18896
---

 libavformat/nutenc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index df5dc6f..4ca761a 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -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));
 



More information about the ffmpeg-cvslog mailing list