aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-04-27 08:29:02 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2011-05-03 22:29:08 -0400
commit25588d3b8a556eb5d0d3239d8c6aee968ea18896 (patch)
treed0df42d940968da09408b7a78f4f90f3a341bb4a
parentfb22c237152ea62f51b8e1c96a782bae4c8709c1 (diff)
downloadffmpeg-25588d3b8a556eb5d0d3239d8c6aee968ea18896.tar.gz
nutenc: don't av_malloc(0).
-rw-r--r--libavformat/nutenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index df5dc6fdf7..4ca761ab40 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));