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

This commit is contained in:
Anton Khirnov 2015-08-05 13:40:03 +02:00
parent 741b352b16
commit 83847cc8fa
1 changed files with 2 additions and 1 deletions

View File

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