Fix issue that detected by static analysis tool 20/141420/1
authorsungwook79.park <sungwook79.park@samsung.com>
Mon, 31 Jul 2017 06:46:01 +0000 (15:46 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Mon, 31 Jul 2017 09:55:14 +0000 (18:55 +0900)
Change-Id: I4b6698fff33df9a627943ec0c9e8315adadacaf6
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
inc/w-input-stt-voice.h
src/w-input-stt-ise.cpp
src/w-input-stt-voice.cpp

index 435b4f9..685f252 100755 (executable)
@@ -76,6 +76,7 @@
 
 #define EVAS_CANDIDATE_LAYER 32000
 
+int init_voicedata(VoiceData *r_voicedata);
 int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata);
 int is_lang_supported_by_stt(char lang[]);
 Evas_Object *show_voice_window(Evas_Object *parent, VoiceData *voicedata);
index 965d36d..7f40e69 100755 (executable)
@@ -48,7 +48,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)(
                        PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__);
                        return;
                }
-               memset(my_voicedata, 0, sizeof(VoiceData));
+               init_voicedata(my_voicedata);
        }
 
        if (my_voicedata) {
index 17524fa..2c2c23c 100755 (executable)
@@ -1743,6 +1743,44 @@ int is_lang_supported_by_stt(char lang[])
        return FALSE;
 }
 
+int init_voicedata(VoiceData *r_voicedata)
+{
+       VoiceData *voicedata = (VoiceData *)r_voicedata;
+       if (!voicedata) {
+               return FALSE;
+       }
+
+       voicedata->voicefw_state = 0;
+       voicedata->voicefw_handle = NULL;
+       voicedata->naviframe = NULL;
+       voicedata->layout_main = NULL;
+       voicedata->progressbar = NULL;
+       voicedata->scroller = NULL;
+       voicedata->main_entry = NULL;
+       voicedata->mic_button = NULL;
+       voicedata->state = STT_STATE_VAL_INIT;
+       voicedata->kbd_lang = NULL;
+       voicedata->start_timer = NULL;
+       voicedata->refresh_timer = NULL;
+       voicedata->progressbar_timer = NULL;
+       voicedata->textblock_timer = NULL;
+       voicedata->guide_text_timer = NULL;
+       voicedata->btn_disabling_timer = NULL;
+       voicedata->power_unlock_timer = NULL;
+
+       voicedata->stt_results.clear();
+       voicedata->partial_result = NULL;
+       voicedata->result_type = 0;
+       voicedata->disclaimer = 0;
+       voicedata->mo = NULL;
+       voicedata->sttfeedback = NULL;
+       voicedata->sttmanager = NULL;
+       voicedata->ieffect = NULL;
+       voicedata->effector = NULL;
+
+       return TRUE;
+}
+
 int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata)
 {
        PRINTFUNC(DLOG_DEBUG, "[init_voice]");