From 7d56aaf97085593d3aa8080451783fc080731539 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Tue, 22 Sep 2009 16:48:43 -0700 Subject: Fix crash in voice recognizer when it fails to load the acoustic model --- srec/ca/acc_basi.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- cgit v1.2.3