ffmpeg | branch: master | Martin Storsjö <mar...@martin.st> | Sat Jan 3 21:27:21 2015 +0200| [9f810a9b374e0ff8e2a19fd8a7347afe2933e229] | committer: Martin Storsjö
libavformat: Check for malloc failures in avformat_new_stream CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö <mar...@martin.st> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f810a9b374e0ff8e2a19fd8a7347afe2933e229 --- libavformat/utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 3ea0ebd..ce715f7 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2525,6 +2525,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) } st->codec = avcodec_alloc_context3(c); + if (!st->codec) { + av_free(st->info); + av_free(st); + return NULL; + } if (s->iformat) { /* no default bitrate if decoding */ st->codec->bit_rate = 0; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog