summaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2014-12-12 22:22:55 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-12 23:37:29 +0100
commita66893ac949864352b36b39e48c4cd72bbd81e54 (patch)
treeed7472759f56cf88b69f797bb9a29736afbeb8c2 /libavformat/utils.c
parentce35a61399cd495fb3d0e8a2f0a18d9d729440e7 (diff)
downloadffmpeg-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.c5
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;
OpenPOWER on IntegriCloud