Fix svace defects 16/53616/1 accepted/tizen/mobile/20151208.130106 accepted/tizen/tv/20151208.130127 accepted/tizen/wearable/20151208.130147 submit/tizen/20151208.091656
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 8 Dec 2015 07:33:08 +0000 (16:33 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 8 Dec 2015 07:36:04 +0000 (16:36 +0900)
[Version] Release 0.3.33
[Profile] Common
[Issue Type] Fix Bug

Change-Id: I54c68fd12482bd805b98eba67fb2788555434125
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-sound-manager.spec
src/sound_manager.c
src/sound_manager_private.c
test/sound_manager_test.c

index 826b0628606060c7f6504c0c59cae6c6a1584069..56ea07305e9a182d477c52b4a585aac1b4eb5012 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-sound-manager
 Summary:    Sound Manager library
-Version:    0.3.32
+Version:    0.3.33
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index f5df673cfd1e7a82fb86eed1d0e5eb0da380c8d8..368db9fd4823437974614ebaab5d4e2f9dbdaf45 100644 (file)
@@ -188,6 +188,8 @@ int sound_manager_create_stream_information(sound_stream_type_e stream_type, sou
        if (g_session_interrupt_cb_table.is_registered)
                return _convert_sound_manager_error_code(__func__, MM_ERROR_SOUND_INTERNAL);
 
+       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_stream_info_count_mutex, MM_ERROR_SOUND_INTERNAL);
+
        sound_stream_info_s *stream_h = malloc(sizeof(sound_stream_info_s));
        if (!stream_h) {
                ret = MM_ERROR_OUT_OF_MEMORY;
@@ -195,19 +197,19 @@ int sound_manager_create_stream_information(sound_stream_type_e stream_type, sou
                memset(stream_h, 0, sizeof(sound_stream_info_s));
                ret = _convert_stream_type(stream_type, &stream_h->stream_type);
                if (ret == MM_ERROR_NONE) {
-                       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_stream_info_count_mutex, MM_ERROR_SOUND_INTERNAL);
                        ret = _make_pa_connection_and_register_focus(stream_h, callback, user_data);
                        if (ret == MM_ERROR_NONE) {
                                *stream_info = (sound_stream_info_h)stream_h;
                                SM_REF_FOR_STREAM_INFO(g_stream_info_count, ret);
                                LOGI("<< leave : stream_h(%p), index(%u), user_cb(%p), cnt(%d), ret(%p)", stream_h, stream_h->index, stream_h->user_cb, g_stream_info_count, ret);
                        }
-                       SM_LEAVE_CRITICAL_SECTION(&g_stream_info_count_mutex);
                }
                if (ret)
                        free(stream_h);
        }
 
+       SM_LEAVE_CRITICAL_SECTION(&g_stream_info_count_mutex);
+
        return _convert_sound_manager_error_code(__func__, ret);
 }
 
index da80a6e58836ac3fbcf3dbb35d126022ed16c92b..02e66a29174a470cc21d7bfb91e192699184c284 100644 (file)
@@ -577,7 +577,7 @@ int _get_stream_conf_info(const char *stream_type, stream_conf_info_s *info)
                item = g_variant_get_variant(child);
                g_variant_iter_init(&iter, item);
                while (g_variant_iter_loop(&iter, "&s", &name)) {
-                       if (!strncmp(name, "none", strlen("none"))) {
+                       if (name && !strncmp(name, "none", strlen("none"))) {
                                /* skip it */
                        } else {
                                /* we use volume type only for out direction */
index 2ddea3ddd75cdaa23764229a152942a825b2184e..0e6ea7ebf0269a3bd6883b7daa770379c45e2212 100644 (file)
@@ -579,7 +579,7 @@ static void interpret(char *cmd)
        }
        case CURRENT_STATUS_SET_VOLUME: {
                static int cnt = 0;
-               sound_type_e type;
+               static sound_type_e type;
                int volume;
                switch (cnt) {
                case 0: