diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-12-12 22:22:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-12 17:10:35 +0100 |
commit | 7caee172049a80e8c048e3d04202d409a06beeca (patch) | |
tree | 8728436a3d77f84ba2c6b93bba30e8ca189c9a2c | |
parent | edec2a4da38f8fff91a57bd1174d4b0b6334dbb7 (diff) | |
download | ffmpeg-7caee172049a80e8c048e3d04202d409a06beeca.tar.gz |
avformat/utils: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a66893ac949864352b36b39e48c4cd72bbd81e54)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-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 5a282a7ce7..5662092139 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3650,6 +3650,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; |