Fix Coverity Issue
[platform/core/api/mediademuxer.git] / src / port_gst / mediademuxer_port_gst.c
index d53637f..d3132d4 100644 (file)
@@ -500,7 +500,10 @@ static int __gst_add_track_info(GstPad *pad, GstCaps *caps, track **head,
                                gst_caps_unref(outcaps);
                                temp->need_codec_data = FALSE;
                        } else if (strstr(temp->caps_string, "mpeg")) {
-                               gst_element_link(parse_element, temp->appsink);
+                               if (!gst_element_link(parse_element, temp->appsink)) {
+                                       MD_E("failed to link parse element to appsink");
+                                       goto ERROR;
+                               }
                        } else {
                                MEDIADEMUXER_LINK_PAD(queue_src_pad, apppad, ERROR);
                        }
@@ -597,7 +600,10 @@ static int __gst_add_track_info(GstPad *pad, GstCaps *caps, track **head,
                        MEDIADEMUXER_SYNC_STATE_WITH_PARENT(parse_element, ERROR);
 
                        /* Link src pad with appSink element */
-                       gst_element_link(parse_element, temp->appsink);
+                       if (!gst_element_link(parse_element, temp->appsink)) {
+                               MD_E("failed to link parse element to appsink");
+                               goto ERROR;
+                       }
                } else {
                        MEDIADEMUXER_LINK_PAD(queue_src_pad, apppad, ERROR);
                }
@@ -1943,4 +1949,4 @@ static int __gst_eos_callback(int track_num, void* user_data)
                MD_E("EOS received, but callback is not set!!!");
        return MD_ERROR_NONE;
 }
-//LCOV_EXCL_STOP
\ No newline at end of file
+//LCOV_EXCL_STOP