diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c b/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c index d7ec1aee38..79fa94fbc5 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c @@ -295,8 +295,10 @@ gst_vaapi_decoder_ffmpeg_close(GstVaapiDecoderFfmpeg *ffdecoder) GstVaapiDecoderFfmpegPrivate * const priv = ffdecoder->priv; if (priv->avctx) { - if (priv->is_opened) + if (priv->is_opened) { avcodec_close(priv->avctx); + priv->is_opened = FALSE; + } av_freep(&priv->avctx->extradata); priv->avctx->extradata_size = 0; }