summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-01 13:58:30 +0100
committerwm4 <wm4@nowhere>2014-12-01 13:58:30 +0100
commitb57ab4bb3bea38c40b5c13bd782c60541e812dd2 (patch)
treed6ad30a56279dfc33c7cfd337ba8394555a81c8e /video/decode
parent67c4117476976cd037e4c7cd2efa98903b417980 (diff)
downloadmpv-b57ab4bb3bea38c40b5c13bd782c60541e812dd2.tar.bz2
mpv-b57ab4bb3bea38c40b5c13bd782c60541e812dd2.tar.xz
vd_lavc: don't crash if codec could not be opened
Fixes #1307.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 6132c0d447..7ac92d6901 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -430,7 +430,7 @@ static void uninit_avctx(struct dec_video *vd)
vd_ffmpeg_ctx *ctx = vd->priv;
AVCodecContext *avctx = ctx->avctx;
- if (avctx)
+ if (avctx && avctx->codec)
avcodec_flush_buffers(avctx);
if (ctx->hwdec && ctx->hwdec->uninit)