From aa3828319a9b9aebf0183f73c00b723c850c7b15 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Tue, 19 Jul 2022 21:59:34 +0800 Subject: Issue #1964 - Update libtremor. Also removed mozilla patches that are already applied upstream. --- media/libtremor/README_MCP | 7 +++++++ media/libtremor/README_MOZILLA | 7 ------- media/libtremor/bug1117571-r19420.patch | 18 ------------------ media/libtremor/bug719612.patch | 21 --------------------- media/libtremor/lib/misc.h | 4 +++- media/libtremor/lib/moz.build | 3 ++- media/libtremor/lib/tremor_floor0.c | 1 + media/libtremor/lib/tremor_floor1.c | 5 ++--- media/libtremor/lib/tremor_info.c | 13 ++++++++++++- media/libtremor/lib/tremor_mdct.c | 2 +- media/libtremor/lib/tremor_synthesis.c | 2 +- media/libtremor/update.sh | 4 ++-- 12 files changed, 31 insertions(+), 56 deletions(-) create mode 100644 media/libtremor/README_MCP delete mode 100644 media/libtremor/README_MOZILLA delete mode 100644 media/libtremor/bug1117571-r19420.patch delete mode 100644 media/libtremor/bug719612.patch diff --git a/media/libtremor/README_MCP b/media/libtremor/README_MCP new file mode 100644 index 0000000000..a1d2bd12ec --- /dev/null +++ b/media/libtremor/README_MCP @@ -0,0 +1,7 @@ +The source from this directory was copied from the libtremor +git repository using the update.sh script. The only changes +made were those applied by update.sh and the addition/update of +Makefile.in files for the UXP build system. + +The upstream release used was https://gitlab.xiph.org/xiph/tremor +The git revision used was 7c30a66346199f3f09017a09567c6c8a3a0eedc8. diff --git a/media/libtremor/README_MOZILLA b/media/libtremor/README_MOZILLA deleted file mode 100644 index ee67b53a05..0000000000 --- a/media/libtremor/README_MOZILLA +++ /dev/null @@ -1,7 +0,0 @@ -The source from this directory was copied from the libtremor -subversion repository using the update.sh script. The only changes -made were those applied by update.sh and the addition/upate of -Makefile.in files for the Mozilla build system. - -The upstream release used was http://svn.xiph.org/trunk/Tremor/ -The subversion revision used was r17547. diff --git a/media/libtremor/bug1117571-r19420.patch b/media/libtremor/bug1117571-r19420.patch deleted file mode 100644 index 02de5e68ff..0000000000 --- a/media/libtremor/bug1117571-r19420.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -r 55f3224d7513 media/libtremor/lib/tremor_synthesis.c ---- a/media/libtremor/lib/tremor_synthesis.c Sat Jan 03 20:02:33 2015 -0800 -+++ b/media/libtremor/lib/tremor_synthesis.c Sun Jan 04 11:17:29 2015 -0800 -@@ -119,13 +119,13 @@ long vorbis_packet_blocksize(vorbis_info - while(v>1){ - modebits++; - v>>=1; - } - - /* read our mode and pre/post windowsize */ - mode=oggpack_read(&opb,modebits); - } -- if(mode==-1)return(OV_EBADPACKET); -+ if(mode==-1 || !ci->mode_param[mode])return(OV_EBADPACKET); - return(ci->blocksizes[ci->mode_param[mode]->blockflag]); - } - - diff --git a/media/libtremor/bug719612.patch b/media/libtremor/bug719612.patch deleted file mode 100644 index 36ac84f66c..0000000000 --- a/media/libtremor/bug719612.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/media/libtremor/lib/tremor_floor1.c b/media/libtremor/lib/tremor_floor1.c ---- a/media/libtremor/lib/tremor_floor1.c -+++ b/media/libtremor/lib/tremor_floor1.c -@@ -103,16 +103,17 @@ static vorbis_info_floor *floor1_unpack - - /* read the post list */ - info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ - rangebits=oggpack_read(opb,4); - if(rangebits<0)goto err_out; - - for(j=0,k=0;jpartitions;j++){ - count+=info->class_dim[info->partitionclass[j]]; -+ if(count>VIF_POSIT)goto err_out; - for(;kpostlist[k+2]=oggpack_read(opb,rangebits); - if(t<0 || t>=(1<postlist[0]=0; - info->postlist[1]=1<books[j]=oggpack_read(opb,8); if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out; if(ci->book_param[info->books[j]]->maptype==0)goto err_out; + if(ci->book_param[info->books[j]]->dim<1)goto err_out; } return(info); diff --git a/media/libtremor/lib/tremor_floor1.c b/media/libtremor/lib/tremor_floor1.c index 12a687ec53..e63ae9fb34 100644 --- a/media/libtremor/lib/tremor_floor1.c +++ b/media/libtremor/lib/tremor_floor1.c @@ -426,7 +426,7 @@ 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-rage values */ + /* guard lookup against out-of-range values */ ly=(ly<0?0:ly>255?255:ly); for(j=1;jposts;j++){ @@ -436,10 +436,9 @@ static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo, hx=info->postlist[current]; hy*=info->mult; - /* guard lookup against out-of-rage values */ + /* guard lookup against out-of-range values */ hy=(hy<0?0:hy>255?255:hy); - render_line(n,lx,hx,ly,hy,out); lx=hx; diff --git a/media/libtremor/lib/tremor_info.c b/media/libtremor/lib/tremor_info.c index 3f3308ef95..24e24ac728 100644 --- a/media/libtremor/lib/tremor_info.c +++ b/media/libtremor/lib/tremor_info.c @@ -227,7 +227,6 @@ static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; int i; - if(!ci)return(OV_EFAULT); /* codebooks */ ci->books=oggpack_read(opb,8)+1; @@ -367,6 +366,10 @@ int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op) /* um... we didn't get the initial header */ return(OV_EBADHEADER); } + if(vc->vendor!=NULL){ + /* previously initialized comment header */ + return(OV_EBADHEADER); + } return(_vorbis_unpack_comment(vc,&opb)); @@ -375,6 +378,14 @@ int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op) /* um... we didn;t get the initial header or comments yet */ return(OV_EBADHEADER); } + if(vi->codec_setup==NULL){ + /* improperly initialized vorbis_info */ + return(OV_EFAULT); + } + if(((codec_setup_info *)vi->codec_setup)->books>0){ + /* previously initialized setup header */ + return(OV_EBADHEADER); + } return(_vorbis_unpack_books(vi,&opb)); diff --git a/media/libtremor/lib/tremor_mdct.c b/media/libtremor/lib/tremor_mdct.c index 4f39e7d531..2aed62c51c 100644 --- a/media/libtremor/lib/tremor_mdct.c +++ b/media/libtremor/lib/tremor_mdct.c @@ -13,7 +13,7 @@ function: normalized modified discrete cosine transform power of two length transform only [64 <= n ] - last mod: $Id: mdct.c,v 1.9 2002/10/16 09:17:39 xiphmont Exp $ + last mod: $Id$ Original algorithm adapted long ago from _The use of multirate filter banks for coding of high quality digital audio_, by T. Sporer, diff --git a/media/libtremor/lib/tremor_synthesis.c b/media/libtremor/lib/tremor_synthesis.c index c7680f6d02..d22cb823c1 100644 --- a/media/libtremor/lib/tremor_synthesis.c +++ b/media/libtremor/lib/tremor_synthesis.c @@ -67,7 +67,7 @@ static int _vorbis_synthesis1(vorbis_block *vb,ogg_packet *op,int decodep){ /* more setup */ vb->granulepos=op->granulepos; - vb->sequence=op->packetno-3; /* first block is third packet */ + vb->sequence=op->packetno; /* first block is third packet */ vb->eofflag=op->e_o_s; if(decodep){ diff --git a/media/libtremor/update.sh b/media/libtremor/update.sh index d27198cfe5..075343c82d 100755 --- a/media/libtremor/update.sh +++ b/media/libtremor/update.sh @@ -30,5 +30,5 @@ cp $1/ivorbiscodec.h ./include/tremor/ivorbiscodec.h cp $1/os.h ./lib/os.h cp $1/COPYING ./COPYING cp $1/README ./README -patch -p3 < ./bug719612.patch -patch -p3 < ./bug1117571-r19420.patch + +echo "Remember to update the version details at README_MCP." -- cgit v1.2.3