From dfe66289c8c505099d1efa0be0cddc5a5d5a6af3 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 22 Mar 2018 20:52:28 +0000 Subject: [PATCH] Don't set final_ph2 to before phonetic in the stack if ix=1. --- src/libespeak-ng/dictionary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index aee3aa4c..fbb6ab71 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -1076,7 +1076,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, } if (ix == 0) return; final_ph = phonetic[ix-1]; - final_ph2 = phonetic[ix-2]; + final_ph2 = phonetic[(ix > 1) ? ix-2 : ix-1]; max_output = output + (N_WORD_PHONEMES-3); // check for overrun