summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libspeex/cb_search.c
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-10-19 21:10:25 +0000
committerThom Johansen <thomj@rockbox.org>2007-10-19 21:10:25 +0000
commit56db5597548d0e9b9733b556a5c14ab4e38547e6 (patch)
tree8846e7d3a15f264853e6ee238994e3522e3bcc5a /apps/codecs/libspeex/cb_search.c
parent6dc3a743addde6146b736ec5e1c71159c2150f95 (diff)
downloadrockbox-56db5597548d0e9b9733b556a5c14ab4e38547e6.tar.gz
rockbox-56db5597548d0e9b9733b556a5c14ab4e38547e6.zip
Sync Speex to SVN. Add new header file to adapt to Speex' new way of doing wrapper functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15209 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/cb_search.c')
-rw-r--r--apps/codecs/libspeex/cb_search.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/codecs/libspeex/cb_search.c b/apps/codecs/libspeex/cb_search.c
index 1090af0e08..ad883cc07f 100644
--- a/apps/codecs/libspeex/cb_search.c
+++ b/apps/codecs/libspeex/cb_search.c
@@ -359,7 +359,11 @@ int update_target
/*"erase" nbest list*/
for (j=0;j<N;j++)
ndist[j]=VERY_LARGE32;
-
+ /* This is not strictly necessary, but it provides an additonal safety
+ to prevent crashes in case something goes wrong in the previous
+ steps (e.g. NaNs) */
+ for (j=0;j<N;j++)
+ best_nind[j] = best_ntarget[j] = 0;
/*For all n-bests of previous subvector*/
for (j=0;j<N;j++)
{
@@ -397,6 +401,7 @@ int update_target
best_nind[n] = best_nind[n-1];
best_ntarget[n] = best_ntarget[n-1];
}
+ /* n is equal to m here, so they're interchangeable */
ndist[m] = err;
best_nind[n] = best_index[k];
best_ntarget[n] = j;