boundary guard in linearmap init was a one-off
authorMonty <xiphmont@xiph.org>
Thu, 7 Dec 2000 07:26:20 +0000 (07:26 +0000)
committerMonty <xiphmont@xiph.org>
Thu, 7 Dec 2000 07:26:20 +0000 (07:26 +0000)
svn path=/trunk/vorbis/; revision=1106

lib/floor0.c

index a63acae..3e6fd20 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.30 2000/11/22 02:54:30 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.31 2000/12/07 07:26:20 xiphmont Exp $
 
  ********************************************************************/
 
@@ -175,9 +175,11 @@ static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi
   for(j=0;j<look->n;j++){
     int val=floor( toBARK((info->rate/2.)/look->n*j) 
                   *scale); /* bark numbers represent band edges */
-    if(val>look->ln)val=look->ln; /* guard against the approximation */
+    if(val>=look->ln)val=look->ln; /* guard against the approximation */
     look->linearmap[j]=val;
+    fprintf(stderr,"%ld:%ld ",val,j);
   }
+  fprintf(stderr,"\n");
   look->linearmap[j]=-1;
 
   look->lsp_look=_ogg_malloc(look->ln*sizeof(float));