mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-05 06:45:39 +00:00
Always pass plist to WritePhMnemonic [clang scan-build]
The clang scan-build static analysis tool warns of a null pointer dereference in WritePhMnemonic. This is only for phonSWITCH codes, which is guarded against in the calls that pass NULL to plist, so the null dereference should not trigger. Always passing plist supresses this warning, and prevents any future errors.
This commit is contained in:
@@ -622,13 +622,13 @@ const char *GetTranslatedPhonemeString(int phoneme_mode)
|
||||
|
||||
if (plist->ph->code != phonSWITCH) {
|
||||
if (plist->synthflags & SFLAG_LENGTHEN)
|
||||
buf = WritePhMnemonic(buf, phoneme_tab[phonLENGTHEN], NULL, use_ipa, NULL);
|
||||
buf = WritePhMnemonic(buf, phoneme_tab[phonLENGTHEN], plist, use_ipa, NULL);
|
||||
if ((plist->synthflags & SFLAG_SYLLABLE) && (plist->type != phVOWEL)) {
|
||||
// syllablic consonant
|
||||
buf = WritePhMnemonic(buf, phoneme_tab[phonSYLLABIC], NULL, use_ipa, NULL);
|
||||
buf = WritePhMnemonic(buf, phoneme_tab[phonSYLLABIC], plist, use_ipa, NULL);
|
||||
}
|
||||
if (plist->tone_ph > 0)
|
||||
buf = WritePhMnemonic(buf, phoneme_tab[plist->tone_ph], NULL, use_ipa, NULL);
|
||||
buf = WritePhMnemonic(buf, phoneme_tab[plist->tone_ph], plist, use_ipa, NULL);
|
||||
}
|
||||
|
||||
len = buf - phon_buf;
|
||||
|
||||
Reference in New Issue
Block a user