ref: 9edb7b4213c583fee49c05ae815ffffc66532a0a
parent: 08a82ffb4581abb8e32b09e320401e8554978172
author: Jean-Marc Valin <[email protected]>
date: Mon Jun 15 07:22:01 EDT 2009
This fixes a folding issue with stereo
--- 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