Fix SVACE defects 81/125981/1 accepted/tizen/unified/20170420.155242 submit/tizen/20170420.054453
authorSeungbae Shin <seungbae.shin@samsung.com>
Wed, 19 Apr 2017 13:17:08 +0000 (22:17 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 19 Apr 2017 13:17:08 +0000 (22:17 +0900)
[Version] 0.10.109
[Profile] Common
[Issue Type] Security

Change-Id: I7d16be3762d2cb156c627c4efa1c3c7dea12ed9f

packaging/libmm-sound.spec
server/mm_sound_mgr_codec.c
server/plugin/wav/mm_sound_plugin_codec_wave.c

index 781301e..e0d8d1d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.10.108
+Version:    0.10.109
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index e33b8be..e057f86 100644 (file)
@@ -593,12 +593,11 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
 #ifdef DEBUG_DETAIL
        debug_enter();
 #endif
-
-       for (plugin_id = 0; g_plugins[plugin_id].GetSupportTypes; plugin_id++) {
-               /* Find codec */
-               codec_type = g_plugins[plugin_id].GetSupportTypes();
-               if (codec_type && (MM_SOUND_SUPPORTED_CODEC_DTMF == codec_type[0]))
-                       break;
+       plugin_id = _MMSoundMgrCodecFindCodecPluginID(MM_SOUND_SUPPORTED_CODEC_DTMF);
+       if (plugin_id == -1) {
+               debug_error("Could not find proper codec plugin!!!");
+               err = MM_ERROR_SOUND_INTERNAL;
+               goto cleanup;
        }
 
        /*The count num means codec type DTMF */
@@ -777,12 +776,11 @@ int MMSoundMgrCodecPlayDtmfWithStreamInfo(int *slotid, const mmsound_mgr_codec_p
 #ifdef DEBUG_DETAIL
        debug_enter();
 #endif
-
-       for (plugin_id = 0; g_plugins[plugin_id].GetSupportTypes; plugin_id++) {
-               /* Find codec */
-               codec_type = g_plugins[plugin_id].GetSupportTypes();
-               if (codec_type && (MM_SOUND_SUPPORTED_CODEC_DTMF == codec_type[0]))
-                       break;
+       plugin_id = _MMSoundMgrCodecFindCodecPluginID(MM_SOUND_SUPPORTED_CODEC_DTMF);
+       if (plugin_id == -1) {
+               debug_error("Could not find proper codec plugin!!!");
+               err = MM_ERROR_SOUND_INTERNAL;
+               goto cleanup;
        }
 
        /*The count num means codec type DTMF */
index 4bda9a9..e4e17d8 100644 (file)
@@ -317,8 +317,7 @@ static int _pa_stream_connect(wave_info_t *h)
        proplist = pa_proplist_new();
        if (!proplist)
                return -1;
-       if (h->stream_type)
-               pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, h->stream_type);
+       pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, h->stream_type);
        if (h->stream_index != -1)
                pa_proplist_setf(proplist, PA_PROP_MEDIA_PARENT_ID, "%d", h->stream_index);