Browse Source

Mark re-used ph_list2 array as undefined

And fix looking after end of array.
master
Samuel Thibault 3 years ago
parent
commit
f1ce2ec423
2 changed files with 3 additions and 1 deletions
  1. 1
    1
      src/libespeak-ng/phonemelist.c
  2. 2
    0
      src/libespeak-ng/translate.c

+ 1
- 1
src/libespeak-ng/phonemelist.c View File

next = phoneme_tab[ph_list2[ix+1].phcode]; next = phoneme_tab[ph_list2[ix+1].phcode];


word_end = false; word_end = false;
if ((plist2+1)->sourceix || ((next != 0) && (next->type == phPAUSE))) if (ix == n_ph_list2 -1 || (plist2+1)->sourceix || ((next != 0) && (next->type == phPAUSE)))
word_end = true; // this phoneme is the end of a word word_end = true; // this phoneme is the end of a word


// check whether a Voice has specified that we should replace this phoneme // check whether a Voice has specified that we should replace this phoneme

+ 2
- 0
src/libespeak-ng/translate.c View File

#include "synthesize.h" // for PHONEME_LIST2, N_PHONEME_LIST, PHON... #include "synthesize.h" // for PHONEME_LIST2, N_PHONEME_LIST, PHON...
#include "ucd/ucd.h" // for ucd_toupper #include "ucd/ucd.h" // for ucd_toupper
#include "voice.h" // for voice, voice_t #include "voice.h" // for voice, voice_t
#include "speech.h" // for MAKE_MEM_UNDEFINED


Translator *translator = NULL; // the main translator Translator *translator = NULL; // the main translator
Translator *translator2 = NULL; // secondary translator for certain words Translator *translator2 = NULL; // secondary translator for certain words
} }
} }


MAKE_MEM_UNDEFINED(&ph_list2, sizeof(ph_list2));
memset(&ph_list2[0], 0, sizeof(ph_list2[0])); memset(&ph_list2[0], 0, sizeof(ph_list2[0]));
ph_list2[0].phcode = phonPAUSE_SHORT; ph_list2[0].phcode = phonPAUSE_SHORT;



Loading…
Cancel
Save