diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-03 14:16:49 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-08 13:03:39 +0100 |
commit | 6308cd4868d2bd5fdf8bfa8dd10856c9a91874f5 (patch) | |
tree | 030ff71c40c966116079b8b033446a2318831fa6 | |
parent | bc1eace1b3654c490cb2c226b3c80854244dbb9a (diff) | |
download | ffmpeg-6308cd4868d2bd5fdf8bfa8dd10856c9a91874f5.tar.gz |
mov: Check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1292518
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 80681b7da7..f603446d98 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1661,7 +1661,11 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb, switch (st->codec->codec_id) { #if CONFIG_DV_DEMUXER case AV_CODEC_ID_DVAUDIO: - c->dv_fctx = avformat_alloc_context(); + c->dv_fctx = avformat_alloc_context(); + if (!c->dv_fctx) { + av_log(c->fc, AV_LOG_ERROR, "dv demux context alloc error\n"); + return AVERROR(ENOMEM); + } c->dv_demux = avpriv_dv_init_demux(c->dv_fctx); if (!c->dv_demux) { av_log(c->fc, AV_LOG_ERROR, "dv demux context init error\n"); |