From d9bae324d4a3e42d96b191161d77515a42e547e3 Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Mon, 17 Feb 2020 13:29:21 +0900 Subject: [PATCH] Fix coverity (Negative array index write) defects [Version] 0.12.61 [Issue Type] Vulnerability Change-Id: I9ce6cd2c12fce3224a3bd4da99008a562cca076a --- mm_sound_client.c | 4 ++-- packaging/libmm-sound.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm_sound_client.c b/mm_sound_client.c index 3098929..a3b4cff 100644 --- a/mm_sound_client.c +++ b/mm_sound_client.c @@ -1117,7 +1117,7 @@ int mm_sound_client_register_focus(int pid, const char *stream_type, focus_init_callback(index, false); cleanup: - if (ret) + if (ret != MM_ERROR_NONE && index >= 0) g_focus_sound_handle[index].is_used = false; MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex); @@ -1404,7 +1404,7 @@ int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e focu focus_init_callback(index, true); cleanup: - if (ret) + if (ret != MM_ERROR_NONE && index >= 0) g_focus_sound_handle[index].is_used = false; MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex); diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 06487e4..805ad8d 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.12.60 +Version: 0.12.61 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4