mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
libs: encoder: Add NULL pointer check for context when finalize.
Context may be NULL if pipeline fail in early stage, and the ensure_context will not be called. Need to add a pointer protection for it.
This commit is contained in:
parent
18d1c75d1a
commit
5ad67ea666
1 changed files with 2 additions and 1 deletions
|
@ -1345,7 +1345,8 @@ gst_vaapi_encoder_finalize (GObject * object)
|
|||
{
|
||||
GstVaapiEncoder *encoder = GST_VAAPI_ENCODER (object);
|
||||
|
||||
gst_vaapi_context_unref (encoder->context);
|
||||
if (encoder->context)
|
||||
gst_vaapi_context_unref (encoder->context);
|
||||
encoder->context = NULL;
|
||||
gst_vaapi_display_replace (&encoder->display, NULL);
|
||||
encoder->va_display = NULL;
|
||||
|
|
Loading…
Reference in a new issue