[FFmpeg-cvslog] qsvenc: do not try to close the encoder if the session is NULL

Anton Khirnov git at videolan.org
Tue Sep 29 14:10:53 CEST 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Aug  5 13:40:03 2015 +0200| [83847cc8fa97e0fc637a0962bafb837acdb6eacc] | committer: Anton Khirnov

qsvenc: do not try to close the encoder if the session is NULL

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=83847cc8fa97e0fc637a0962bafb837acdb6eacc
---

 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;



More information about the ffmpeg-cvslog mailing list