vd_lavc: don't crash if codec could not be opened

Fixes #1307.
This commit is contained in:
wm4 2014-12-01 13:58:30 +01:00
parent 67c4117476
commit b57ab4bb3b
1 changed files with 1 additions and 1 deletions

View File

@ -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)