[Speex-dev] (small) bug in nb_decode?

Jean-Marc Valin
Tue, 25 Oct 2005 15:22:50 -0000

Le lundi 24 octobre 2005 ? 21:55 -0700, Tom Harper a ?crit
:
> Hi,
>
> So I got a crash on the following code:
>             k1=SUBMODE(lpc_enh_k1);
>             k2=SUBMODE(lpc_enh_k2);
> which in the newer codebase is:
>          bw_lpc(SUBMODE(lpc_enh_k1), st->interp_qlpc, awk1,
> st->lpcSize);
>          bw_lpc(SUBMODE(lpc_enh_k2), st->interp_qlpc, awk2,
> st->lpcSize);
>
Are you really sure you didn't have some corruption elsewhere?

> I am not sure if the newer code will have the same issue but the
> following check is performed in nb_decode_lost, so I figure the
> same thing should be done in decode... right?
>
> add (or equivalent):
>
>        if  (st->submodes[st->submodeID] != NULL)
>          {
>             k1=SUBMODE(lpc_enh_k1);
>             k2=SUBMODE(lpc_enh_k2);
>             k3=(1-(1-r*k1)/(1-r*k2))/r;
>          }else  {
>             k1=k2=0.7;
>                         k3 = 0.0f;
>          }

Normally, this shouldn't be necessary because there's a check for
st->submodes[st->submodeID] != NULL a bit before
that.
>
	Jean-Marc