Revision: 9847
http://cmusphinx.svn.sourceforge.net/cmusphinx/?rev=9847&view=rev
Author: dhdfu
Date: 2010-03-12 01:38:13 +0000 (Fri, 12 Mar 2010)
Log Message:
-----------
do not crash if lm2 is -1
Modified Paths:
--------------
trunk/sphinxbase/src/libsphinxbase/lm/lm3g_templates.c
Modified: trunk/sphinxbase/src/libsphinxbase/lm/lm3g_templates.c
===================================================================
--- trunk/sphinxbase/src/libsphinxbase/lm/lm3g_templates.c 2010-03-12 00:34:15 UTC (rev 9846)
+++ trunk/sphinxbase/src/libsphinxbase/lm/lm3g_templates.c 2010-03-12 01:38:13 UTC (rev 9847)
@@ -164,7 +164,7 @@
trigram_t *tg;
tginfo_t *tginfo, *prev_tginfo;
- if ((base->n < 3) || (lw1 < 0))
+ if ((base->n < 3) || (lw1 < 0) || (lw2 < 0))
return (lm3g_bg_score(model, lw2, lw3, n_used));
prev_tginfo = NULL;
@@ -223,7 +223,7 @@
static int32
lm3g_template_raw_score(ngram_model_t *base, int32 wid,
- int32 *history, int32 n_hist,
+ int32 *history, int32 n_hist,
int32 *n_used)
{
NGRAM_MODEL_TYPE *model = (NGRAM_MODEL_TYPE *)base;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|