diff options
author | wm4 <wm4@nowhere> | 2014-12-12 17:28:22 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-12 17:28:22 +0100 |
commit | 2b337d67a472cf88c9b1a4ee7da07820b8e4a5c9 (patch) | |
tree | f22031e5f6ea6df946375749fc5600d3a32bc65a /video | |
parent | 5012e5156d0094f33d85caf03db1b368a6456520 (diff) | |
download | mpv-2b337d67a472cf88c9b1a4ee7da07820b8e4a5c9.tar.bz2 mpv-2b337d67a472cf88c9b1a4ee7da07820b8e4a5c9.tar.xz |
Check some mallocs
Fixes #1337.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 455ae892db..3201ac85cf 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -353,6 +353,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder, ctx->hwdec_fmt = 0; ctx->avctx = avcodec_alloc_context3(lavc_codec); AVCodecContext *avctx = ctx->avctx; + if (!ctx->avctx) + return; avctx->bit_rate = 0; avctx->opaque = vd; avctx->codec_type = AVMEDIA_TYPE_VIDEO; @@ -360,6 +362,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->refcounted_frames = 1; ctx->pic = av_frame_alloc(); + if (!ctx->pic) + return; if (ctx->hwdec) { avctx->thread_count = 1; |