diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-12-12 22:22:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-12 23:37:29 +0100 |
commit | a66893ac949864352b36b39e48c4cd72bbd81e54 (patch) | |
tree | ed7472759f56cf88b69f797bb9a29736afbeb8c2 /libavformat/utils.c | |
parent | ce35a61399cd495fb3d0e8a2f0a18d9d729440e7 (diff) | |
download | ffmpeg-streaming-a66893ac949864352b36b39e48c4cd72bbd81e54.zip ffmpeg-streaming-a66893ac949864352b36b39e48c4cd72bbd81e54.tar.gz |
avformat/utils: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 5a2a72d..8aee511 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3652,6 +3652,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) st->info->last_dts = AV_NOPTS_VALUE; 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; |