Module: libav
Branch: release/11
Commit: f4252bb6f1dd4c240f0daaa3e15ef517945dd023

Author:    Vittorio Giovara <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Wed Jun  3 14:16:49 2015 +0100

mov: Check memory allocation

CC: [email protected]
Bug-Id: CID 1292518

---

 libavformat/mov.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index f116a27..3d2ec8c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1440,7 +1440,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");

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to