Skip to content
Snippets Groups Projects
Commit 6d454d8d authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

This fixes a potential assertion failure with some very weak signals

parent 02428d6c
No related branches found
No related tags found
No related merge requests found
......@@ -147,9 +147,17 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, ec_
j=0; do {
sum += X[j];
} while (++j<N);
if (sum == 0)
#ifdef FIXED_POINT
if (sum <= K)
#else
if (sum <= EPSILON)
#endif
{
X[0] = 16384;
j=1; do
X[j]=0;
while (++j<N);
sum = 16384;
}
/* Do we have sufficient accuracy here? */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment