Check length of extra_info to prevent empty string 17/260617/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 25 Jun 2021 08:03:30 +0000 (17:03 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Wed, 30 Jun 2021 00:59:25 +0000 (00:59 +0000)
Change-Id: I68bfcb742fa2e17e111e8eae3beb4fefd94b8c1c
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_player.c

index e065150de957786274cb547c73aa82b14e39fd24..a1c2c0e5016f7d2bbfcd030dba873a17c823f8fc 100644 (file)
@@ -236,7 +236,7 @@ void __player_focus_state_watch_cb(int id, sound_stream_focus_mask_e focus_mask,
                return;
        }
 
-       if (SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION == reason && NULL != extra_info && 0 == strncmp(extra_info, "TTSD_MODE_INTERRUPT", strlen(extra_info))) {
+       if (SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION == reason && NULL != extra_info && strlen(extra_info) > 0 && 0 == strncmp(extra_info, "TTSD_MODE_INTERRUPT", strlen(extra_info))) {
                /* If the focus is changed by "Interrupt" mode and current players of "SR" and "Noti" modes are on going, please stop all players. */
                SLOG(LOG_INFO, tts_tag(), "[Player INFO] All stop the playing or the request to play. audio state(%d)", g_audio_state);