summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/floor1.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libtremor/floor1.c')
-rw-r--r--apps/codecs/libtremor/floor1.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/codecs/libtremor/floor1.c b/apps/codecs/libtremor/floor1.c
index ae92b23058..65286399d0 100644
--- a/apps/codecs/libtremor/floor1.c
+++ b/apps/codecs/libtremor/floor1.c
@@ -361,7 +361,7 @@ static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in){
361 } 361 }
362 } 362 }
363 363
364 fit_value[i]=val+predicted; 364 fit_value[i]=(val+predicted)&0x7fff;;
365 fit_value[look->loneighbor[i-2]]&=0x7fff; 365 fit_value[look->loneighbor[i-2]]&=0x7fff;
366 fit_value[look->hineighbor[i-2]]&=0x7fff; 366 fit_value[look->hineighbor[i-2]]&=0x7fff;
367 367
@@ -393,14 +393,19 @@ static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo,
393 int hx=0; 393 int hx=0;
394 int lx=0; 394 int lx=0;
395 int ly=fit_value[0]*info->mult; 395 int ly=fit_value[0]*info->mult;
396 /* guard lookup against out-of-range values */
397 ly=(ly<0?0:ly>255?255:ly);
398
396 for(j=1;j<look->posts;j++){ 399 for(j=1;j<look->posts;j++){
397 int current=look->forward_index[j]; 400 int current=look->forward_index[j];
398 int hy=fit_value[current]&0x7fff; 401 int hy=fit_value[current]&0x7fff;
399 if(hy==fit_value[current]){ 402 if(hy==fit_value[current]){
400 403
404 hx=info->postlist[current];
401 hy*=info->mult; 405 hy*=info->mult;
402 hx=info->postlist[current]; 406 /* guard lookup against out-of-range values */
403 407 hy=(hy<0?0:hy>255?255:hy);
408
404 render_line(lx, ly, hx, hy, out); 409 render_line(lx, ly, hx, hy, out);
405 410
406 lx=hx; 411 lx=hx;