ref: 7aecadda2f72cbf1f55209293dc63e01bb743035
parent: 178758b81a4e05c244c876e4a985e48bd98f84b6
author: Jean-Marc Valin <[email protected]>
date: Sat Apr 7 19:03:24 EDT 2012
Fixes a bug introduced by the previous commit celt_ilog2() could be called with 0 which is undefined.
--- a/celt/pitch.c
+++ b/celt/pitch.c
@@ -106,7 +106,7 @@
opus_val16 lpc[4], mem[4]={0,0,0,0};
#ifdef FIXED_POINT
int shift;
- opus_val32 maxabs = celt_maxabs32(x[0], len);
+ opus_val32 maxabs = MAX32(1, celt_maxabs32(x[0], len));
if (C==2)
maxabs = MAX32(maxabs, celt_maxabs32(x[1], len));
shift = IMAX(0,celt_ilog2(maxabs)-11);