From: <th...@ke...> - 2009-11-02 11:36:28
|
Module: gst-plugins-bad Branch: master Commit: 570a0bb65c3b0c97e4daf534e76cb2c283e13d2d URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=570a0bb65c3b0c97e4daf534e76cb2c283e13d2d Author: Jan Schmidt <th...@no...> Date: Mon Nov 2 11:33:19 2009 +0000 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. --- gst/autoconvert/gstautoconvert.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index bdd5035..9602027 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); |