libs: decoder: Don't unref null object

** (gst-launch-1.0:9789): CRITICAL **: 15:29:09.330:
  gst_vaapi_context_unref: assertion 'context != NULL' failed
This commit is contained in:
Seungha Yang 2020-01-13 15:34:54 +09:00 committed by Víctor Manuel Jáquez Leal
parent ad31d5bb81
commit 3737692dd4

View file

@ -483,8 +483,10 @@ gst_vaapi_decoder_finalize (GObject * object)
decoder->frames = NULL;
}
gst_vaapi_context_unref (decoder->context);
decoder->context = NULL;
if (decoder->context) {
gst_vaapi_context_unref (decoder->context);
decoder->context = NULL;
}
decoder->va_context = VA_INVALID_ID;
gst_vaapi_display_replace (&decoder->display, NULL);