mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-05 08:00:36 +00:00
TranslateWord2: Don't process invalid phonemes.
If ph_code is not located in the phoneme_tab, the resulting ph value will be NULL. This does not normally happen, but it can happen if word_phonemes contains garbage data, such as with the 1.49.2 multi-word logic when processing words like 'riposted'.
This commit is contained in:
@@ -1618,6 +1618,10 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
|||||||
|
|
||||||
// Add the phonemes to the first stage phoneme list (ph_list2)
|
// Add the phonemes to the first stage phoneme list (ph_list2)
|
||||||
ph = phoneme_tab[ph_code];
|
ph = phoneme_tab[ph_code];
|
||||||
|
if (ph == NULL) {
|
||||||
|
printf("Invalid phoneme code %d\n", ph_code);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ph_code == phonSWITCH) {
|
if (ph_code == phonSWITCH) {
|
||||||
ph_list2[n_ph_list2].phcode = ph_code;
|
ph_list2[n_ph_list2].phcode = ph_code;
|
||||||
|
|||||||
Reference in New Issue
Block a user