From: Jan Schmidt Date: Mon, 2 Nov 2009 11:33:19 +0000 (+0000) Subject: resindvd: Take a copy of the passed plugin features X-Git-Tag: 1.19.3~507^2~17853 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=570a0bb65c3b0c97e4daf534e76cb2c283e13d2d;p=platform%2Fupstream%2Fgstreamer.git resindvd: Take a copy of the passed plugin features Clarify the ownership of the internal plugin feature list by making a copy of any passed list. Avoids crashes when freeing a passed list, or leaks caused by not freeing any internally built list. --- diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index bdd50359b4..9602027771 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -289,9 +289,10 @@ gst_auto_convert_set_property (GObject * object, break; case PROP_FACTORIES: GST_AUTOCONVERT_LOCK (autoconvert); - if (autoconvert->factories == NULL) - autoconvert->factories = g_value_get_pointer (value); - else + if (autoconvert->factories == NULL) { + GList *factories = g_value_get_pointer (value); + autoconvert->factories = gst_plugin_feature_list_copy (factories); + } else GST_WARNING_OBJECT (object, "Can not reset factories after they" " have been set or auto-discovered"); GST_AUTOCONVERT_UNLOCK (autoconvert);