diff --git a/src/libespeak-ng/phonemelist.c b/src/libespeak-ng/phonemelist.c index 4bd5c52f..83fd3f38 100644 --- a/src/libespeak-ng/phonemelist.c +++ b/src/libespeak-ng/phonemelist.c @@ -73,7 +73,7 @@ static int SubstitutePhonemes(PHONEME_LIST *plist_out) next = phoneme_tab[ph_list2[ix+1].phcode]; word_end = false; - if ((plist2+1)->sourceix || ((next != 0) && (next->type == phPAUSE))) + if (ix == n_ph_list2 -1 || (plist2+1)->sourceix || ((next != 0) && (next->type == phPAUSE))) word_end = true; // this phoneme is the end of a word // check whether a Voice has specified that we should replace this phoneme diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 6a51ac91..0db80fd4 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -2047,6 +2047,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) } } + MAKE_MEM_UNDEFINED(&ph_list2, sizeof(ph_list2)); memset(&ph_list2[0], 0, sizeof(ph_list2[0])); ph_list2[0].phcode = phonPAUSE_SHORT;