webrtc_source_loopback: Check the return value of gst_bin_add() 34/319034/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 10 Oct 2024 22:45:09 +0000 (07:45 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 14 Oct 2024 01:19:42 +0000 (10:19 +0900)
[Version] 0.4.68
[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 859fa00988003ebbc1fab485b5c8ba3acd1614e0..d182a2725ceec3a61f66848e228d5b1d6dbb4ec4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.4.67
+Version:    0.4.68
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 70999a111f30eb337e1fdbdc95bab9f2506cbfda..8fa2039367e1d980f2967235f14e4eeeb152a5dd 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);