Fixes a divide-by-zero in narrowband mode with small frame size
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Fri, 10 Sep 2010 21:40:31 +0000 (17:40 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sat, 11 Sep 2010 00:29:00 +0000 (20:29 -0400)
libcelt/bands.c

index 5b1b382..00158b3 100644 (file)
@@ -255,6 +255,8 @@ int folding_decision(const CELTMode *m, celt_norm *X, int *average, int *last_de
    
    N0 = M*m->shortMdctSize;
 
+   if (M*(eBands[end]-eBands[end-1]) <= 8)
+      return 0;
    for (c=0;c<C;c++)
    {
       for (i=0;i<end;i++)