From 6449d45e617e5f79ca4093421f00f10d43753e58 Mon Sep 17 00:00:00 2001 From: Sangjung Woo Date: Wed, 15 Jul 2020 18:36:05 +0900 Subject: [PATCH] [Demux] Bugfix for set_property function If `tensorpick` property of demux element is set twice by calling g_object_set() function, the previous value should be removed and new one should be written. However, the value is appended and it can make a problem. This patch fixes this bug. Signed-off-by: Sangjung Woo --- gst/nnstreamer/tensor_demux/gsttensordemux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/nnstreamer/tensor_demux/gsttensordemux.c b/gst/nnstreamer/tensor_demux/gsttensordemux.c index ccf0c26..9fce6d3 100644 --- a/gst/nnstreamer/tensor_demux/gsttensordemux.c +++ b/gst/nnstreamer/tensor_demux/gsttensordemux.c @@ -546,6 +546,12 @@ gst_tensor_demux_set_property (GObject * object, guint prop_id, const gchar *param = g_value_get_string (value); gchar **strv = g_strsplit_set (param, ",.;/", -1); gint num = g_strv_length (strv); + + /* Before setting the new Tensor Pick data, the existing one should be removed. */ + if (filter->tensorpick) { + g_list_free (filter->tensorpick); + filter->tensorpick = NULL; + } for (i = 0; i < num; i++) { val = g_ascii_strtoll (strv[i], NULL, 10); filter->tensorpick = -- 2.7.4