summaryrefslogtreecommitdiff
path: root/drivers/vorbis/floor0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vorbis/floor0.c')
-rw-r--r--drivers/vorbis/floor0.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/vorbis/floor0.c b/drivers/vorbis/floor0.c
index 4c32e91991..213cce4ec8 100644
--- a/drivers/vorbis/floor0.c
+++ b/drivers/vorbis/floor0.c
@@ -5,13 +5,13 @@
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
- * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: floor backend 0 implementation
- last mod: $Id: floor0.c 17558 2010-10-22 00:24:41Z tterribe $
+ last mod: $Id: floor0.c 19457 2015-03-03 00:15:29Z giles $
********************************************************************/
@@ -147,6 +147,9 @@ static vorbis_look_floor *floor0_look(vorbis_dsp_state *vd,
vorbis_info_floor *i){
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(*look));
+
+ (void)vd;
+
look->m=info->order;
look->ln=info->barkmap;
look->vi=info;
@@ -165,7 +168,7 @@ static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){
if(ampraw>0){ /* also handles the -1 out of data case */
long maxval=(1<<info->ampbits)-1;
float amp=(float)ampraw/maxval*info->ampdB;
- int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks));
+ int booknum=oggpack_read(&vb->opb,ov_ilog(info->numbooks));
if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
codec_setup_info *ci=vb->vd->vi->codec_setup;
@@ -177,10 +180,9 @@ static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){
vector */
float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1));
- for(j=0;j<look->m;j+=b->dim)
- if(vorbis_book_decodev_set(b,lsp+j,&vb->opb,b->dim)==-1)goto eop;
+ if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m)==-1)goto eop;
for(j=0;j<look->m;){
- for(k=0;k<b->dim;k++,j++)lsp[j]+=last;
+ for(k=0;j<look->m && k<b->dim;k++,j++)lsp[j]+=last;
last=lsp[j-1];
}