segfault fix in bark_noise_median()
authorMonty <xiphmont@xiph.org>
Thu, 1 Feb 2001 01:29:17 +0000 (01:29 +0000)
committerMonty <xiphmont@xiph.org>
Thu, 1 Feb 2001 01:29:17 +0000 (01:29 +0000)
svn path=/trunk/vorbis/; revision=1236

lib/psy.c

index 529e01f..7f3f942 100644 (file)
--- a/lib/psy.c
+++ b/lib/psy.c
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.37 2001/01/30 23:40:33 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.38 2001/02/01 01:29:17 xiphmont Exp $
 
  ********************************************************************/
 
@@ -590,8 +590,8 @@ static void bark_noise_median(long n,float *b,float *f,float *noise,
        countbelow+=radix[median];
       }
 
-      while((countabove+countbelow)*thresh[i]<(countbelow-radix[median])
-           && median+1<BINCOUNT){
+      while(median<LASTBIN && 
+           (countabove+countbelow)*thresh[i]<(countbelow-radix[median])){
        countabove+=radix[median];
        countbelow-=radix[median];
        median++;