decoder: vc1: flush dpb only if opened

Flush the decode picture buffer, if and only if, the decoder is
started. Otherwise the dpb structure might be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=742922
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-07-11 08:43:04 +02:00
parent 19c0c8a973
commit fcc08627e5

View file

@ -1393,7 +1393,8 @@ gst_vaapi_decoder_vc1_flush (GstVaapiDecoder * base_decoder)
GstVaapiDecoderVC1 *const decoder = GST_VAAPI_DECODER_VC1_CAST (base_decoder);
GstVaapiDecoderVC1Private *const priv = &decoder->priv;
gst_vaapi_dpb_flush (priv->dpb);
if (priv->is_opened)
gst_vaapi_dpb_flush (priv->dpb);
return GST_VAAPI_DECODER_STATUS_SUCCESS;
}