From 801189c02f591475c84bf27057acb756c479c32c Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Tue, 11 Dec 2018 15:54:51 +0800 Subject: [PATCH] msdk: decrease the reference count of object Otherwise there are reference leaks if failed to clone or join a mfx session --- sys/msdk/gstmsdkcontext.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/msdk/gstmsdkcontext.c b/sys/msdk/gstmsdkcontext.c index 2511bfa700..ae7b305fda 100644 --- a/sys/msdk/gstmsdkcontext.c +++ b/sys/msdk/gstmsdkcontext.c @@ -283,12 +283,14 @@ gst_msdk_context_new_with_parent (GstMsdkContext * parent) status = MFXCloneSession (parent_priv->session, &priv->session); if (status != MFX_ERR_NONE) { GST_ERROR ("Failed to clone mfx session"); + g_object_unref (obj); return NULL; } status = MFXJoinSession (parent_priv->session, priv->session); if (status != MFX_ERR_NONE) { GST_ERROR ("Failed to join mfx session"); + g_object_unref (obj); return NULL; }