Fixed a rare crash using vorbis-psy
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sat, 16 Jun 2007 13:51:30 +0000 (13:51 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sat, 16 Jun 2007 13:51:30 +0000 (13:51 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@13135 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/vorbis_psy.h

index fbdb7c5..6871057 100644 (file)
@@ -39,7 +39,7 @@
 #define NOISE_COMPAND_LEVELS 40
 
 
-#define todB(x)   ((x)==0?-400.f:log((x)*(x))*4.34294480f)
+#define todB(x)   ((x)>1e-13?log((x)*(x))*4.34294480f:-30)
 #define fromdB(x) (exp((x)*.11512925f))  
 
 /* The bark scale equations are approximations, since the original