[xiph-commits] r13154 - trunk/vorbis/lib

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Jun 20 21:22:33 PDT 2007


Author: xiphmont
Date: 2007-06-20 21:22:33 -0700 (Wed, 20 Jun 2007)
New Revision: 13154

Modified:
   trunk/vorbis/lib/res0.c
Log:
I had forgotten that the res2 top level interprets limits differently 
than res0 and res1; guarding code (and garbled playback) fixed



Modified: trunk/vorbis/lib/res0.c
===================================================================
--- trunk/vorbis/lib/res0.c	2007-06-21 00:51:15 UTC (rev 13153)
+++ trunk/vorbis/lib/res0.c	2007-06-21 04:22:33 UTC (rev 13154)
@@ -847,15 +847,15 @@
   /* move all this setup out later */
   int samples_per_partition=info->grouping;
   int partitions_per_word=look->phrasebook->dim;
-  int end=(info->end<vb->pcmend/2?info->end:vb->pcmend/2);
-  int n=end-info->begin;
+  int max=(vb->pcmend*ch)>>1;
+  int end=(info->end<max?info->end:max);
+  int n=info->end-info->begin;
 
   if(n>0){
     int partvals=n/samples_per_partition;
     int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
     int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword));
     
-    
     for(i=0;i<ch;i++)if(nonzero[i])break;
     if(i==ch)return(0); /* no nonzero vectors */
     



More information about the commits mailing list