speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] modules - ibmtts: fix the maximum number of possible languages


From: Gilles Casse
Subject: [PATCH] modules - ibmtts: fix the maximum number of possible languages
Date: Wed, 20 Jan 2010 22:43:36 +0100

According to the languages installed, the speech dispatcher module could
crash at init time (assert in alloc_voice_list).
This issue was observed for example with the Brazilian Portuguese language.

This issue was introduced by the recent commit 
24eb7bb308fff4fc3ce5ed05cbf31372898a69d9

Signed-off-by: Gilles Casse <gcasse at oralux.org>
---
 ChangeLog            |    5 +++++
 src/modules/ibmtts.c |    5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 605c6f6..40b604f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-17  Gilles Casse <gcasse at oralux.org>
+ 
+       * src/modules/ibmtts.c: 
+         - fix MAX_NB_OF_LANGUAGES.
+
 2009-12-30  Gilles Casse <gcasse at oralux.org>
  
        * src/modules/ibmtts.c, config/modules/ibmtts.conf: 
diff --git a/src/modules/ibmtts.c b/src/modules/ibmtts.c
index dc34489..cbaf052 100644
--- a/src/modules/ibmtts.c
+++ b/src/modules/ibmtts.c
@@ -359,6 +359,7 @@ static eciLocale eciLocales[] = {
     {NULL, 0, NULL}
 };
 
+#define MAX_NB_OF_LANGUAGES (sizeof(eciLocales)/sizeof(eciLocales[0]) - 1)
 
 /* Public functions */
 
@@ -1616,8 +1617,6 @@ cleanup1:
 void 
 alloc_voice_list()
 {
-#define MAX_NB_OF_LANGUAGES 13
-
     enum ECILanguageDialect aLanguage[MAX_NB_OF_LANGUAGES];
     int nLanguages = MAX_NB_OF_LANGUAGES;
     int i = 0;
@@ -1630,7 +1629,7 @@ alloc_voice_list()
     if (!ibmtts_voice_list)
        return;
 
-    DBG("Ibmtts: nLanguages=%d", nLanguages);
+    DBG("Ibmtts: nLanguages=%d/%d", nLanguages, MAX_NB_OF_LANGUAGES);
     for(i=0; i<nLanguages; i++) {
        /* look for the language name */
        int j;
-- 
1.5.6.3


--------------050602060302090402010301--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]