From 2aa511f6bdac6364fe09a0004e4e14b3fc17a6c2 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Wed, 8 Dec 2010 17:28:17 +0000 Subject: libtremor: merge upstream revisions 17541, 17542, 17543, 17544, 17545, 17546, 17547, 17555, 17572, bringing in various fixes and finally bringing our libtremor up to date, for now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28773 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libtremor/floor1.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'apps/codecs/libtremor/floor1.c') 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){ } } - fit_value[i]=val+predicted; + fit_value[i]=(val+predicted)&0x7fff;; fit_value[look->loneighbor[i-2]]&=0x7fff; fit_value[look->hineighbor[i-2]]&=0x7fff; @@ -393,14 +393,19 @@ static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo, int hx=0; int lx=0; int ly=fit_value[0]*info->mult; + /* guard lookup against out-of-range values */ + ly=(ly<0?0:ly>255?255:ly); + for(j=1;jposts;j++){ int current=look->forward_index[j]; int hy=fit_value[current]&0x7fff; if(hy==fit_value[current]){ + hx=info->postlist[current]; hy*=info->mult; - hx=info->postlist[current]; - + /* guard lookup against out-of-range values */ + hy=(hy<0?0:hy>255?255:hy); + render_line(lx, ly, hx, hy, out); lx=hx; -- cgit v1.2.3