mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-13 17:23:44 +00:00
Prevent TranslateRoman reading stack data from Lookup.
This commit is contained in:
@@ -2980,8 +2980,12 @@ int Lookup(Translator *tr, const char *word, char *ph_out)
|
|||||||
if (flags[0] & FLAG_TEXTMODE) {
|
if (flags[0] & FLAG_TEXTMODE) {
|
||||||
say_as = option_sayas;
|
say_as = option_sayas;
|
||||||
option_sayas = 0; // don't speak replacement word as letter names
|
option_sayas = 0; // don't speak replacement word as letter names
|
||||||
strncpy0(text, word1, sizeof(text));
|
// NOTE: TranslateRoman checks text[-2], so pad the start of text to prevent
|
||||||
flags0 = TranslateWord(tr, text, NULL, NULL);
|
// it reading data on the stack.
|
||||||
|
text[0] = ' ';
|
||||||
|
text[1] = ' ';
|
||||||
|
strncpy0(text+2, word1, sizeof(text)-2);
|
||||||
|
flags0 = TranslateWord(tr, text+2, NULL, NULL);
|
||||||
strcpy(ph_out, word_phonemes);
|
strcpy(ph_out, word_phonemes);
|
||||||
option_sayas = say_as;
|
option_sayas = say_as;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user