Commit 203f6512 authored by Monty's avatar Monty

I had forgotten that the res2 top level interprets limits differently

than res0 and res1; guarding code (and garbled playback) fixed

svn path=/trunk/vorbis/; revision=13154
parent 20d113be
...@@ -847,15 +847,15 @@ int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl, ...@@ -847,15 +847,15 @@ int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
/* move all this setup out later */ /* move all this setup out later */
int samples_per_partition=info->grouping; int samples_per_partition=info->grouping;
int partitions_per_word=look->phrasebook->dim; int partitions_per_word=look->phrasebook->dim;
int end=(info->end<vb->pcmend/2?info->end:vb->pcmend/2); int max=(vb->pcmend*ch)>>1;
int n=end-info->begin; int end=(info->end<max?info->end:max);
int n=info->end-info->begin;
if(n>0){ if(n>0){
int partvals=n/samples_per_partition; int partvals=n/samples_per_partition;
int partwords=(partvals+partitions_per_word-1)/partitions_per_word; int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword)); int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword));
for(i=0;i<ch;i++)if(nonzero[i])break; for(i=0;i<ch;i++)if(nonzero[i])break;
if(i==ch)return(0); /* no nonzero vectors */ if(i==ch)return(0); /* no nonzero vectors */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment