From: Wook Song Date: Wed, 13 Mar 2019 06:59:47 +0000 (+0900) Subject: [Transform] Handle error due to wrong option string gracefully X-Git-Tag: v0.1.2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b950581d178457c238f876105b6476648939545d;p=platform%2Fupstream%2Fnnstreamer.git [Transform] Handle error due to wrong option string gracefully 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 --- diff --git a/gst/nnstreamer/tensor_transform/tensor_transform.c b/gst/nnstreamer/tensor_transform/tensor_transform.c index d409749..a0164ef 100644 --- a/gst/nnstreamer/tensor_transform/tensor_transform.c +++ b/gst/nnstreamer/tensor_transform/tensor_transform.c @@ -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));