From 718bf3b39e9f1febc6e93d4b9c20a37cabe0b9e3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Dec 2014 13:58:30 +0100 Subject: vd_lavc: don't crash if codec could not be opened Fixes #1307. --- video/decode/vd_lavc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3