# HG changeset patch # User Thomas Daede # Date 1521175629 25200 # Node ID 5cd5586a2f48424a9031a3fa4c782954a9df9a52 # Parent 494e5d5278ba6f5fdda9a2bb9ac7ca772653ee4a Bug 1446062: libtremor Vorbis fix. r=jmspeex a=dveditz diff --git a/media/libtremor/lib/tremor_codebook.c b/media/libtremor/lib/tremor_codebook.c --- a/media/libtremor/lib/tremor_codebook.c +++ b/media/libtremor/lib/tremor_codebook.c @@ -253,26 +253,26 @@ long vorbis_book_decodevs_add(codebook * if(shift>=0){ for (i = 0; i < step; i++) { entry[i]=decode_packed_entry_number(book,b); if(entry[i]==-1)return(-1); t[i] = book->valuelist+entry[i]*book->dim; } for(i=0,o=0;idim;i++,o+=step) - for (j=0;j>shift; }else{ for (i = 0; i < step; i++) { entry[i]=decode_packed_entry_number(book,b); if(entry[i]==-1)return(-1); t[i] = book->valuelist+entry[i]*book->dim; } for(i=0,o=0;idim;i++,o+=step) - for (j=0;jbinarypoint; if(shift>=0){ for(i=0;ivaluelist+entry*book->dim; - for (j=0;jdim;) + for (j=0;idim;) a[i++]+=t[j++]>>shift; } }else{ for(i=0;ivaluelist+entry*book->dim; - for (j=0;jdim;) + for (j=0;idim;) a[i++]+=t[j++]<<-shift; } } } return(0); } /* unlike the others, we guard against n not being an integer number @@ -347,41 +347,41 @@ long vorbis_book_decodev_set(codebook *b /* decode vector / dim granularity gaurding is done in the upper layer */ long vorbis_book_decodevv_add(codebook *book,ogg_int32_t **a,\ long offset,int ch, oggpack_buffer *b,int n,int point){ if(book->used_entries>0){ long i,j,entry; int chptr=0; int shift=point-book->binarypoint; - + int m=offset+n; if(shift>=0){ - for(i=offset;ivaluelist+entry*book->dim; - for (j=0;jdim;j++){ + for (j=0;idim;j++){ a[chptr++][i]+=t[j]>>shift; if(chptr==ch){ chptr=0; i++; } } } } }else{ - for(i=offset;ivaluelist+entry*book->dim; - for (j=0;jdim;j++){ + for (j=0;idim;j++){ a[chptr++][i]+=t[j]<<-shift; if(chptr==ch){ chptr=0; i++; } } } }