Commit 76432655 authored by Ronald S. Bultje's avatar Ronald S. Bultje

nutenc: check malloc return values.

parent f8af93ab
......@@ -588,6 +588,12 @@ static int write_header(AVFormatContext *s){
nut->chapter = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
nut->time_base= av_mallocz(sizeof(AVRational )*(s->nb_streams +
s->nb_chapters));
if (!nut->stream || (s->nb_chapters && !nut->chapter) || !nut->time_base) {
av_freep(&nut->stream);
av_freep(&nut->chapter);
av_freep(&nut->time_base);
return AVERROR(ENOMEM);
}
for(i=0; i<s->nb_streams; i++){
AVStream *st= s->streams[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment