From e328178da90f44690e0076f4dbfd16da9175f441 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 30 Jul 2016 16:38:51 +0200 Subject: qsvdec: only access hwaccel_context is the pixel format is QSV We do not strictly specify that hwaccel_context must be cleared if no hwaccel is used. Reported-By: wm4 --- libavcodec/qsvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec') diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 4802932ea7..e19eba5b52 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -106,7 +106,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) return AVERROR(ENOMEM); } - if (avctx->hwaccel_context) { + if (avctx->pix_fmt == AV_PIX_FMT_QSV && avctx->hwaccel_context) { AVQSVContext *user_ctx = avctx->hwaccel_context; session = user_ctx->session; iopattern = user_ctx->iopattern; -- cgit v1.2.3