[Tizen/API] bugfix when passing a wrong pipeline command
authorSangjung Woo <sangjung.woo@samsung.com>
Mon, 8 Apr 2019 04:54:03 +0000 (13:54 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 9 Apr 2019 01:00:04 +0000 (10:00 +0900)
If passing a wrong pipeline command such as non-existent element or
erroneous pipeline, assertion failure occurs in
nns_pipeline_construct(). This is mainly because gst_parse_launch()
could return non-NULL even though the error is set. So this patch checks
both the return value and GError value.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
tizen-api/src/tizen-api-pipeline.c

index 96b80db..37ddee0 100644 (file)
@@ -274,7 +274,7 @@ nns_pipeline_construct (const char *pipeline_description, nns_pipeline_h * pipe)
   }
 
   pipeline = gst_parse_launch (pipeline_description, &err);
-  if (pipeline == NULL) {
+  if (pipeline == NULL || err) {
     if (err) {
       dlog_print (DLOG_ERROR, DLOG_TAG,
           "Cannot parse and launch the given pipeline = [%s], %s",