| commit | 9edb7b4213c583fee49c05ae815ffffc66532a0a | [log] [tgz] |
|---|---|---|
| author | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | Mon Jun 15 11:22:01 2009 -0400 |
| committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | Mon Jun 15 11:22:01 2009 -0400 |
| tree | bda4624009cafdeb0955a7f946af5e4e29c2f037 | |
| parent | 08a82ffb4581abb8e32b09e320401e8554978172 [diff] [blame] |
This fixes a folding issue with stereo
diff --git a/libcelt/vq.c b/libcelt/vq.c index 7ab6cdc..fb9e2cb 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c
@@ -341,11 +341,11 @@ { int j; const int C = CHANNELS(m); - int id = N0 % (C*B); + int id = (N0*C) % (C*B); /* Here, we assume that id will never be greater than N0, i.e. that no band is wider than N0. In the unlikely case it happens, we set everything to zero */ - if (id+C*N>N0) + if (id+C*N>N0*C) for (j=0;j<C*N;j++) P[j] = 0; else