summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2009-09-22 16:48:43 -0700
committerMarco Nelissen <marcone@google.com>2009-09-22 16:48:43 -0700
commit7d56aaf97085593d3aa8080451783fc080731539 (patch)
treebb3307abf487c7d25b8826df2730cc7c9a5ea8db
parent89837f8a3ded67a109342fb0a1c0840f83fca6e5 (diff)
downloadsrec-7d56aaf97085593d3aa8080451783fc080731539.tar.gz
Fix crash in voice recognizer when it fails to load the acoustic modelandroid-sdk-tools_r4android-sdk-tools_r3android-sdk-2.0_r1android-2.0_r1
-rw-r--r--srec/ca/acc_basi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/srec/ca/acc_basi.c b/srec/ca/acc_basi.c
index b3be53e..4cc89a5 100644
--- a/srec/ca/acc_basi.c
+++ b/srec/ca/acc_basi.c
@@ -75,6 +75,11 @@ int CA_LoadAcousticSub(CA_Acoustic *hAcoust, char *subname, CA_AcoustInputParams
{
/* SpeechWorks image format! */
hAcoust->swimodel = load_swimodel(subname);
+ if (hAcoust->swimodel == NULL)
+ {
+ // failed to load, load_swimodel will have printed an error to the log
+ return 0;
+ }
hAcoust->is_loaded = ESR_TRUE;
return 1;
}