Commit 9edb7b42 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

This fixes a folding issue with stereo

parent 08a82ffb
......@@ -341,11 +341,11 @@ static void fold(const CELTMode *m, int N, celt_norm_t *Y, celt_norm_t * restric
{
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment