summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-01 13:58:30 +0100
committerAlessandro Ghedini <alessandro@ghedini.me>2014-12-01 15:41:17 +0100
commit718bf3b39e9f1febc6e93d4b9c20a37cabe0b9e3 (patch)
tree8cd3c51f6ca0e92f74281494a10d32e51896afa4
parent5ecb381d78b40b0e5d84e0fcd339261bd34973da (diff)
downloadmpv-718bf3b39e9f1febc6e93d4b9c20a37cabe0b9e3.tar.bz2
mpv-718bf3b39e9f1febc6e93d4b9c20a37cabe0b9e3.tar.xz
vd_lavc: don't crash if codec could not be opened
Fixes #1307.
-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)