[libav-devel] [PATCH 03/11] qsvenc: do not try to close the encoder if the session is NULL

Anton Khirnov anton at khirnov.net
Wed Aug 12 15:07:14 CEST 2015


---
 libavcodec/qsvenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 752777b..d6a731f 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -482,7 +482,8 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
 {
     QSVFrame *cur;
 
-    MFXVideoENCODE_Close(q->session);
+    if (q->session)
+        MFXVideoENCODE_Close(q->session);
     if (q->internal_session)
         MFXClose(q->internal_session);
     q->session          = NULL;
-- 
2.0.0



More information about the libav-devel mailing list