test: Add missing lock 00/304200/1 accepted/tizen/8.0/unified/20240112.155130
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 11 Jan 2024 07:19:49 +0000 (16:19 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 12 Jan 2024 03:16:37 +0000 (03:16 +0000)
[Version] 0.4.34
[Issue Type] Coverity defect (MISSING_LOCK)

Change-Id: Id969572e1896b660b620216ecb376a43d4a891fd
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
(cherry picked from commit 410af450e62993aa1ad54bd56b51f3449b9292b0)

packaging/capi-media-webrtc.spec
test/webrtc_test.c

index 679a78572edacf83acbe939bc7b4fc8bd34f4f60..0f9b1bbb8871d73c466d53b20f9524a4106187b7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.4.33
+Version:    0.4.34
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b0ce35a2b1d7404676f5aa9b92f250487cc412ae..7531fec5ddb515638238134ef00b618a2d95a2dd 100644 (file)
@@ -2221,9 +2221,9 @@ static void __media_packet_source_buffer_state_changed_cb(unsigned int source_id
        }
        g_mutex_lock(&conn->packet_sources[i].mutex);
        conn->packet_sources[i].is_overflowed = (state == WEBRTC_MEDIA_PACKET_SOURCE_BUFFER_STATE_OVERFLOW);
-       g_mutex_unlock(&conn->packet_sources[i].mutex);
        if (!conn->packet_sources[i].is_overflowed)
                g_cond_signal(&conn->packet_sources[i].cond);
+       g_mutex_unlock(&conn->packet_sources[i].mutex);
 }
 
 static void _webrtc_media_packet_source_set_buffer_state_changed_cb(int index, unsigned int source_id)
@@ -3007,8 +3007,10 @@ static void _stop_pushing_packet(int index, int source_id)
 
        RET_IF(!g_ad.conns[index].packet_sources[i].src_pipeline, "already stopped for pushing packet");
 
+       g_mutex_lock(&g_ad.conns[index].packet_sources[i].mutex);
        if (g_ad.conns[index].packet_sources[i].is_overflowed)
                g_cond_signal(&g_ad.conns[index].packet_sources[i].cond);
+       g_mutex_unlock(&g_ad.conns[index].packet_sources[i].mutex);
 
        g_ad.conns[index].packet_sources[i].is_stop_requested = true;