./src/espeak-ng -v ar --path=$PWD 5777 would access out of the vowel_stress array, because GetVowelStress, in the phcode == phonSYLLABIC case, only increments count if stress is 0. This code seems fishy, and is not coherent with the loop in SetWordStress. I made it similar to the other case above, thus fixing the out-of-bound access. This is modifiying the stress in the tn test, I don't know whether this is expected.master
} else if (phcode == phonSYLLABIC) { | } else if (phcode == phonSYLLABIC) { | ||||
// previous consonant phoneme is syllablic | // previous consonant phoneme is syllablic | ||||
vowel_stress[count] = (char)stress; | vowel_stress[count] = (char)stress; | ||||
if ((stress == 0) && (control & 1)) | |||||
vowel_stress[count++] = STRESS_IS_UNSTRESSED; // syllabic consonant, usually unstressed | |||||
if ((stress < 0) && (control & 1)) | |||||
vowel_stress[count] = STRESS_IS_UNSTRESSED; // syllabic consonant, usually unstressed | |||||
count++; | |||||
} | } | ||||
*ph_out++ = phcode; | *ph_out++ = phcode; | ||||
} | } | ||||
p = phonetic; | p = phonetic; | ||||
/* Note: v progression has to strictly follow the vowel_stress production in GetVowelStress */ | |||||
while (((phcode = *p++) != 0) && (output < max_output)) { | while (((phcode = *p++) != 0) && (output < max_output)) { | ||||
if ((ph = phoneme_tab[phcode]) == NULL) | if ((ph = phoneme_tab[phcode]) == NULL) | ||||
continue; | continue; | ||||
else if (((ph->type == phVOWEL) && !(ph->phflags & phNONSYLLABIC)) || (*p == phonSYLLABIC)) { | else if (((ph->type == phVOWEL) && !(ph->phflags & phNONSYLLABIC)) || (*p == phonSYLLABIC)) { | ||||
// a vowel, or a consonant followed by a syllabic consonant marker | // a vowel, or a consonant followed by a syllabic consonant marker | ||||
assert(v <= vowel_count); | |||||
v_stress = vowel_stress[v]; | v_stress = vowel_stress[v]; | ||||
tr->prev_last_stress = v_stress; | tr->prev_last_stress = v_stress; | ||||
test_phon ta "n'a:n k'Vn.n.a:d.i s'a:ppid.,Uve:n | test_phon ta "n'a:n k'Vn.n.a:d.i s'a:ppid.,Uve:n | ||||
'adVna:l ;'enVkkU 'orU k'e:d.Um v'Vra:dU" "நான் கண்ணாடி சாப்பிடுவேன், அதனால் எனக்கு ஒரு கேடும் வராது." "Taml" | 'adVna:l ;'enVkkU 'orU k'e:d.Um v'Vra:dU" "நான் கண்ணாடி சாப்பிடுவேன், அதனால் எனக்கு ஒரு கேடும் வராது." "Taml" | ||||
test_phon te "n'e:nu g'a:Ju t'inag,alanu m'ariju 'ala: c'e:sina: n'a:ku 'e:mi 'ibbandi l'e:du" "నేను గాజు తినగలను మరియు అలా చేసినా నాకు ఏమి ఇబ్బంది లేదు" "Telu" | test_phon te "n'e:nu g'a:Ju t'inag,alanu m'ariju 'ala: c'e:sina: n'a:ku 'e:mi 'ibbandi l'e:du" "నేను గాజు తినగలను మరియు అలా చేసినా నాకు ఏమి ఇబ్బంది లేదు" "Telu" | ||||
test_phon tn "B'aTU B'oKl B'a ts'i:tswl B'a g,olUl,os-'igill_:_: ll g'o l,ekallk'ana k'a s-'iRiti_:_: ll d,itSwan'elU | |||||
test_phon tn "B'aTU B'oKl B'a ts'i:tswl B'a g,olUl,os-ig'ill_:_: ll g'o l,ekallk'ana k'a s-iR'iti_:_: ll d,itSwan'elU | |||||
B'a_| aB'etswl g'o_| ak'an^a_:_: ll _|m,aik'ul#U | B'a_| aB'etswl g'o_| ak'an^a_:_: ll _|m,aik'ul#U | ||||
,m-ml B'a tSwan'ets-i g'o d,iRll'ana k'a _|m'owa_! wa B,okaul'eNgwl" "Batho botlhe ba tsetswe ba gololosegile le go lekalekana ka seriti le ditshwanelo. Ba abetswe go akanya le maikutlo, mme ba tshwanetse go direlana ka mowa wa bokaulengwe." "Latn" | ,m-ml B'a tSwan'ets-i g'o d,iRll'ana k'a _|m'owa_! wa B,okaul'eNgwl" "Batho botlhe ba tsetswe ba gololosegile le go lekalekana ka seriti le ditshwanelo. Ba abetswe go akanya le maikutlo, mme ba tshwanetse go direlana ka mowa wa bokaulengwe." "Latn" | ||||
test_phon tk "tYRkm'WntSW | test_phon tk "tYRkm'WntSW |