From 520c15d134f1b9c6525c5fb3da5a1af8bcb7cd66 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 28 Apr 2006 13:10:07 +0000 Subject: [PATCH] gst/gstminiobject.c: Taking a NULL miniobject is valid, fix the case where we try to unref the NULL miniobject. Original commit message from CVS: * gst/gstminiobject.c: (gst_value_take_mini_object): Taking a NULL miniobject is valid, fix the case where we try to unref the NULL miniobject. --- ChangeLog | 6 ++++++ gst/gstminiobject.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ed4776a73e..a6cb633b3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-04-28 Wim Taymans + + * gst/gstminiobject.c: (gst_value_take_mini_object): + Taking a NULL miniobject is valid, fix the case where + we try to unref the NULL miniobject. + 2006-04-28 Wim Taymans Patch by: Stefan Kost diff --git a/gst/gstminiobject.c b/gst/gstminiobject.c index 2e0569e5be..279ec732f5 100644 --- a/gst/gstminiobject.c +++ b/gst/gstminiobject.c @@ -425,8 +425,11 @@ gst_value_take_mini_object (GValue * value, GstMiniObject * mini_object) g_return_if_fail (mini_object == NULL || GST_IS_MINI_OBJECT (mini_object)); pointer_p = &value->data[0].v_pointer; + /* takes additional refcount */ gst_mini_object_replace ((GstMiniObject **) pointer_p, mini_object); - gst_mini_object_unref (mini_object); + /* remove additional refcount */ + if (mini_object) + gst_mini_object_unref (mini_object); } /**