diff options
author | Marco Nelissen <marcone@google.com> | 2009-09-23 08:04:56 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-09-23 08:04:56 -0700 |
commit | 471dacfa43513695aaf1d517c6645b247ce736db (patch) | |
tree | 415136be5cc0120e48ecb2268fafe44825c2de0c | |
parent | 29609d50c9058064d3dde87fce740056171af99e (diff) | |
parent | 7d56aaf97085593d3aa8080451783fc080731539 (diff) | |
download | srec-471dacfa43513695aaf1d517c6645b247ce736db.tar.gz |
am 7d56aaf9: Fix crash in voice recognizer when it fails to load the acoustic model
Merge commit '7d56aaf97085593d3aa8080451783fc080731539' into eclair-plus-aosp
* commit '7d56aaf97085593d3aa8080451783fc080731539':
Fix crash in voice recognizer when it fails to load the acoustic model
-rw-r--r-- | srec/ca/acc_basi.c | 5 |
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; } |