Module: libav Branch: release/11 Commit: 932caa50a5dec7f2a69da8a417ccae84d19ae5e5
Author: Martin Storsjö <[email protected]> Committer: Luca Barbato <[email protected]> Date: Sat Jan 3 21:27:21 2015 +0200 libavformat: Check for malloc failures in avformat_new_stream CC: [email protected] Signed-off-by: Martin Storsjö <[email protected]> (cherry picked from commit 9f810a9b374e0ff8e2a19fd8a7347afe2933e229) Signed-off-by: Luca Barbato <[email protected]> --- libavformat/utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 973ab94..73e3039 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2535,6 +2535,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; _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
