webrtc_source_loopback: Check the return value of gst_bin_add() 19/318919/2
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 10 Oct 2024 22:45:09 +0000 (07:45 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 11 Oct 2024 01:51:43 +0000 (10:51 +0900)
[Version] 1.1.36
[Issue Type] Coverity defect

Change-Id: I220c49e058ee0ac90da7e499bb701f397005b615
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_source_loopback.c

index 3e0afd343656cc8db890fa7eb7afe4564b703ea3..5ccc6fc9c753872fc9bd5b142bfdb4e75d42b0f2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    1.1.35
+Version:    1.1.36
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 83401ee856c346421c705f7580d4d767e2df65d6..9089b70418e391775c3f3a916f1d47681c34bbc8 100644 (file)
@@ -295,7 +295,11 @@ static int __build_loopback_render_pipeline(webrtc_s *webrtc, webrtc_gst_slot_s
        } else {
                int ret = WEBRTC_ERROR_NONE;
 
-               gst_bin_add(GST_BIN(source->av[idx].render.pipeline), appsrc);
+               if (!gst_bin_add(GST_BIN(source->av[idx].render.pipeline), appsrc)) {
+                       LOG_ERROR("failed to gst_bin_add(), adding [%s] to [%s]", GST_ELEMENT_NAME(appsrc), GST_ELEMENT_NAME(source->av[idx].render.pipeline));
+                       gst_object_unref(GST_OBJECT(appsrc));
+                       goto error;
+               }
 
                if (type == MEDIA_TYPE_AUDIO)
                        ret = __build_loopback_audiosink(source, appsrc);