[Transform] Handle error due to wrong option string gracefully
authorWook Song <wook16.song@samsung.com>
Wed, 13 Mar 2019 06:59:47 +0000 (15:59 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 15 Mar 2019 01:31:42 +0000 (10:31 +0900)
This patch replaces assertion code for handling wrong option string with
the code returning error code in order to gracefully terminate the
pipeline with proper error messages.

Signed-off-by: Wook Song <wook16.song@samsung.com>
gst/nnstreamer/tensor_transform/tensor_transform.c

index d409749..a0164ef 100644 (file)
@@ -1385,7 +1385,8 @@ gst_tensor_transform_transform (GstBaseTransform * trans,
   uint8_t *inptr, *outptr;
   GstMapInfo inInfo, outInfo;
 
-  g_assert (filter->loaded);
+  g_return_val_if_fail (filter->loaded, GST_FLOW_ERROR);
+
   g_assert (gst_buffer_map (inbuf, &inInfo, GST_MAP_READ));
   g_assert (gst_buffer_map (outbuf, &outInfo, GST_MAP_WRITE));