[Demux] Fix test break when performance option=1
authorsewon.oh <sewon.oh@samsung.com>
Tue, 31 Jul 2018 02:42:59 +0000 (11:42 +0900)
committer함명주/동작제어Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Tue, 31 Jul 2018 09:43:48 +0000 (18:43 +0900)
occur segmentation error when testing
```bash
nnstreamer/tests $ ./testAll.sh 1
0:00:00.025194169 21004 0x7f47b0002d90 DEBUG            tensordemux gsttensordemux.c:437:gst_tensor_demux_chain:<demux>  Number or Tensors: 1
0:00:00.025209492 21004 0x7f47b0002d90 DEBUG            tensordemux gsttensordemux.c:307:gst_get_tensor_pad:<demux> createing pad: 0(0th)

****** skip ********

0:00:00.008473223 21133      0x1b51e80 DEBUG            tensordemux gsttensordemux.c:488:gst_tensor_demux_chain:<demux> pushing buffer with timestamp 99:99:99.999999999
Caught SIGSEGV
Spinning.  Please run 'gdb gst-launch-1.0 21170' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
```

I guess that cause is to typecast integer pointer to char pointer without converting.
This is temporary fix.

Signed-off-by: sewon.oh <sewon.oh@samsung.com>
gst/tensor_demux/gsttensordemux.c

index 8214a0f..1285577 100644 (file)
@@ -577,7 +577,8 @@ gst_tensor_demux_get_property (GObject * object, guint prop_id,
       gchar **strings;
 
       for (list = filter->tensorpick; list != NULL; list = list->next) {
-        g_ptr_array_add (arr, list->data);
+        g_ptr_array_add (arr, g_strdup_printf ("%i",
+                GPOINTER_TO_INT (list->data)));
       }
       g_ptr_array_add (arr, NULL);
       strings = (gchar **) g_ptr_array_free (arr, FALSE);